110 Commits

Author SHA1 Message Date
alexhudson 2d1708f9cc Tagging 0.6 release. 2009-08-30 17:38:20 +00:00
alexhudson f81addc50e Minor fix to distribution version 2009-08-30 17:37:54 +00:00
alexhudson c352aae824 Merge in install fix from trunk 2009-08-30 17:14:32 +00:00
alexhudson 51820ccde5 Set version number on branch for release 2009-08-30 17:14:05 +00:00
alexhudson 906368d5a9 Take last trunk merge for 0.6 2009-08-30 16:32:45 +00:00
alexhudson a1f3775418 Re-merge trunk to releng-0.6 including r1171/1172 mixup... 2009-08-23 16:54:18 +00:00
alexhudson bf4ce71c5e Don't always run Bongo as the 'root' user 2009-08-23 16:45:42 +00:00
alexhudson fca127c820 Merge latest changes from trunk 2009-08-23 13:55:27 +00:00
alexhudson 13a73ebb6e Merge 0.6 with latest trunk bits 2009-08-21 15:40:01 +00:00
alexhudson a03597ae55 Branching for 0.6 release 2009-08-19 09:01:10 +00:00
pfelt dfd1a7c8db -- fix: a couple of non StrictCompile() compiler warnings 2009-08-19 05:11:43 +00:00
pfelt 2276228922 -- fix: non StrictCompile() fixes throwing errors on compile, mostly due to mis-defined callbacks 2009-08-19 04:39:40 +00:00
alexhudson 86a1333b83 Remove old TODO file; nothing seems relevant now... 2009-08-18 20:40:40 +00:00
alexhudson 704830ecbc Update INSTALL instructions to reflect reality. 2009-08-18 19:44:37 +00:00
alexhudson a5e179056d Remove sqlite3 from the project 2009-08-18 19:38:02 +00:00
alexhudson 9aceadc114 Remove libical import from project. 2009-08-18 19:35:26 +00:00
alexhudson a5dffbbeeb Install perms fixes. 2009-08-18 15:57:39 +00:00
alexhudson 54eb30ea62 Attempt to make Bongo compile on older libical apis 2009-08-18 14:08:17 +00:00
pfelt 71157dde98 -- do we need to pre-compile the __init__.py ? 2009-08-17 23:36:16 +00:00
pfelt 9e4d4958d5 -- fix: bongo-storetool so that it works right
-- fix: install all required files
2009-08-17 23:26:47 +00:00
pfelt 1c70d90f6f -- fix: bongo-queuetool so that it works right
-- fix: some calls in libbongo were no longer needed
2009-08-17 22:53:51 +00:00
lhaig fbc5e0e189 Updated the sles init script to fix an rpmlint complaint 2009-08-17 20:33:38 +00:00
pfelt 1d2453c1a2 -- fix: the opensuse gcc by default was catching the missing function parameters. 2009-08-17 15:01:33 +00:00
pfelt 9aea4e15c8 -- fix: multiple defines from the python code. the cmake stuff doesn't detect the defines coming from python so we are getting duplicate errors. 2009-08-17 01:50:59 +00:00
pfelt f8d4464438 -- get the init scripts re-configured. they will not get installed anywhere, but they'll be modified accordingly. 2009-08-16 21:30:21 +00:00
pfelt 0db5f0086a -- fix a strict compile error that LanceHaig found due to a missing function prototype 2009-08-16 20:45:49 +00:00
pfelt 44a5d81ccf -- remove unneeded portions of memmgr, move remaining bits to bongoutil
-- refactor a little bit of code
2009-08-15 21:39:22 +00:00
pfelt 6798503631 -- fix: make json compile cleanly 2009-08-15 17:26:40 +00:00
pfelt b378e96840 -- the beginnings of the all out removal of memmgr and merging it elsewhere. 2009-08-15 17:19:49 +00:00
pfelt 23c9f1e29f -- fix: make memmgr compile cleanly
-- remove some unneeded code
2009-08-12 02:35:55 +00:00
pfelt 05ef3f431a -- fix: make connio compile cleanly. 2009-08-08 03:16:33 +00:00
pfelt ded3f9f3b7 -- fix: the gcry_md_read() function returns an unsigned char *. the sprintf conversion to hex was failing due to signedness 2009-08-02 04:38:24 +00:00
pfelt 041619f2e0 -- fix: a bug with ranges on the replace command 2009-08-01 23:26:52 +00:00
alexhudson 56eef6558b Slay the evil array beast. This is why I want my own array api. 2009-07-20 14:47:00 +00:00
pfelt d7b1ef0bec -- cleanup the parameter list for ConnClose(), ConnCloseAll(), ConnStartup 2009-07-19 23:31:35 +00:00
alexhudson 94912df75c Change back array index call to the right form.. 2009-07-19 22:01:26 +00:00
alexhudson ea708940e9 Give explicit array element size instead of trying to figure it out 2009-07-19 20:19:48 +00:00
alexhudson 6b8b45e92d Update Xpl to compile cleanly, remove some unused code. 2009-07-19 13:43:11 +00:00
alexhudson 4f01ac0677 Make bongocal compile strictly, try to fix some of the bugs in the library... 2009-07-19 13:24:54 +00:00
alexhudson 5d4dc5377c Add GArrayFind* prototypes to headers 2009-07-19 09:20:28 +00:00
alexhudson 14f49c3da8 Minor change to allow compilation - odd ' removed. 2009-07-19 09:19:49 +00:00
alexhudson e495ddfd04 Additional flag for strict compile - GNU_SOURCE gives us both POSIX and BSD defines 2009-07-18 21:50:58 +00:00
pfelt 2b417a9c7d -- remove BongoArray and replace it with GArray
-- StrictCompile antispam and fix all the accompanying warnings
2009-07-18 18:09:53 +00:00
pfelt 924d624c43 -- fix: i'm not sure how this worked previously, but i was not using an initialized memory pool 2009-07-17 05:05:40 +00:00
pfelt 71bcaa7d9a -- fix a minor bug where not having a callback breaks 2009-07-16 12:23:57 +00:00
alexhudson 8bb3ebbec0 Put back callback handlers in mempool implementation. 2009-07-16 06:57:04 +00:00
alexhudson 20f8e515f2 Turn on strict compiling for the store.. bit messy in places :S 2009-07-12 08:27:13 +00:00
pfelt e6ff789f6e -- fix: zero out slice allocated memory 2009-07-10 23:03:26 +00:00
alexhudson 828ab1006d Merge memmgr-glib experiment onto trunk 2009-07-10 08:34:06 +00:00
alexhudson f93c6a9d1e Add Debian files to the source tarball 2009-07-10 07:50:57 +00:00
alexhudson 0b219f4bd1 Debian init scripts 2009-07-09 17:57:34 +00:00
alexhudson c79ba43c69 Pretty obvious bug thrown up by new memory allocator... 2009-06-01 15:53:30 +00:00
alexhudson 8f7c48ea3c Add explicit check for GLib 2.6 or better - shouldn't affect packages. 2009-05-31 19:02:43 +00:00
alexhudson 75b4057d49 Simplified autogen for slight build system revamp 2009-05-31 16:50:49 +00:00
alexhudson dd158ea55a Fix a potential leak in the query-parser. 2009-05-31 12:45:55 +00:00
pfelt b95822f9ef -- fix a couple of memory leaks in store. there is still one in there somewhere reproduceable by sending gobs of "collections /mail" store command consecutively 2009-05-31 04:48:01 +00:00
pfelt 8d464bdbfc -- fix the error message displayed in the log when tls fails.
-- a dirty fix for messages getting stuck in my queue due to the remote server not sending a dh prime "long enough" (GNUTLS_E_DH_PRIME_UNACCEPTABLE).  one can now specify using the message flags that tls should not be used.  the default is to use tls.
2009-05-20 04:26:07 +00:00
pfelt 154430b8e4 -- fix: bug where mail would not be delivered to local users who have no rules. 2009-05-12 21:50:06 +00:00
alexhudson b7e4ae5eb7 Make PROPGET response codes be properly understood for now. 2009-05-09 10:40:29 +00:00
alexhudson 0845d02c39 Extra PROPGET fixes for decimal / hexadecimal responses 2009-05-03 19:45:38 +00:00
alexhudson 4660ee8966 Make PROPGET work for nmap client library 2009-05-03 19:39:08 +00:00
alexhudson 5cbb7d3524 Make PROPGET response sanely 2009-05-03 19:29:02 +00:00
pfelt d4a8e0f8f2 -- fix a double free in avirus
-- the last commit also committed building rules by default
2009-04-25 03:15:31 +00:00
pfelt 5c26d034c4 -- fix the resend the email a ton of times bug. the queue was out of sync causing delivery to appear to fail 2009-04-25 02:41:50 +00:00
pfelt 5c4ac00fb5 -- this should fix bounce messages to create the envelope properly 2009-04-24 04:00:22 +00:00
alexhudson 91955db366 Make MIME work-ish 2009-04-19 21:39:20 +00:00
pfelt 5d70bf41de -- fix memory leak: when conntrace is enabled there is a memory leak because NMAPQuit() did not free the trace destination. 2009-04-18 20:45:24 +00:00
pfelt 23afd06ef7 -- rules.c: memory leak fix. when using a linked list it is important to free more than just the head
-- bongoagent.c: if the type is array and the subtype is string, free the strings since we MemStrdup()'d them initially.
2009-04-17 18:08:57 +00:00
ahixon 77f271876d Fix viewing domain aliases. 2009-04-16 02:43:15 +00:00
pfelt 6e6727b194 -- fix a memory leak in the rules agent. there is still one in there somewhere
-- fix a memory leak in ReadBongoConfiguration().  we weren't freeing the memory
2009-04-16 00:44:52 +00:00
alexhudson f773e2a2f4 Possibly a rather embarrassing bug fix... :) 2009-04-15 19:44:22 +00:00
alexhudson ea6e60b217 Fix up minor pre-processor bug 2009-04-09 13:21:19 +00:00
pfelt d795c59e95 -- change the cleanup a bit for the *BongoConfiguration() functions. There is still a double free in there somewhere that needs to be found
-- change to FreeBongoConfiguration() to free the strings in the array if string is the subtype.
-- Duplicate strings so that we don't overwrite the memory later
2009-04-05 15:42:57 +00:00
pfelt 41f8747ca9 -- initial version of the rules agent. rules are stored in a format that is going to change and as such this agent is *not* production ready nor does it build by default.
-- there is a double free in the json code somewhere.
-- i'm sure there are a ton of other bugs too so use at your own risk!
2009-04-04 07:40:50 +00:00
alexhudson 07b37b9e90 Another fsync-related patch, this time to better secure data coming in from the queue 2009-03-13 13:45:01 +00:00
alexhudson a95844b863 Attempt to ensure store doesn't get snared by ext4 data loss - fatpelt, you may want to do something similar for queue (hint, hint ;) 2009-03-13 13:29:44 +00:00
pfelt ca04d0241e -- some fixes for opensuse 64bit build
-- a fix for gnutls detection of invalid sessions
2009-03-07 19:14:54 +00:00
pfelt 6df48db556 -- fixed a compile warning for an unused function
-- changed the logging in DeliverMessage() to hopefully find out what the process is doing a bit better.
2009-02-25 06:04:01 +00:00
pfelt 45476cc47b -- the queue really should not try to send via smtp failed messages every 10 seconds. it'll re-try now approx every 10 minutes 2009-02-17 04:06:09 +00:00
pfelt 6f3e23c50e -- fixed a couple of implicit declarations which should help the opensuse build process 2009-02-15 23:00:45 +00:00
alexhudson 70d6da04ab Make MsgSQLResultTextPtr() return a value instead of random rubbish. 2009-02-15 22:00:37 +00:00
pfelt d8a8373931 -- several changes to clear up some compiler warnings 2009-02-14 17:11:30 +00:00
pfelt aff7758c85 -- remove unneeded files 2009-02-14 05:28:15 +00:00
forcev 3bdd4cbde9 Fix the init file to enable building on >=openSUSE 11.0 2009-02-11 22:40:07 +00:00
alexhudson 17e3c2a308 Make the count in ConnReadToConnUntilEOS be signed so that we detect "error" conditions. Need to review if this is ok wrt. 'int' being a big enough value. 2009-02-10 13:05:44 +00:00
pfelt 449353f91b -- fixed a bug in ConnReadToAllocatedBuffer() where we end up reading way out past the end of our buffer. 2009-02-06 06:37:24 +00:00
alexhudson f8fe125870 Add back some more missing files... 2009-01-27 15:04:26 +00:00
alexhudson 13f9dcd0ca Put back the stuff that got nuked somehow :/ 2009-01-27 14:39:28 +00:00
alexhudson 1632cfd68a Remove CLucene! 2009-01-27 14:26:54 +00:00
alexhudson c224849f87 Add sqlite3 3.6 for people on ancient OSes :) 2009-01-27 14:23:04 +00:00
alexhudson a4d5ccfb34 Remove old version of sqlite from bongo import; will break build for people using it. 2009-01-27 14:18:01 +00:00
pfelt 8ce1339a7a -- the previous commit on this, while it worked, was a messed up way of doing it. this is a tad cleaner. 2009-01-26 04:35:44 +00:00
pfelt 26f865c448 -- fix a couple of conntrace related bugs. conntrace should now work again 2009-01-25 16:51:52 +00:00
pfelt 54e2e82bf4 -- i don't really like the way that i fixed the memory leak in connio, however i wanted to get this out to users asap for testing. this fixed a major memory leak for me when tls is used
-- there were a couple of remaining memory leaks in smtpc that have been fixed and i've changed the threadpool size from 5-20 down to 1.  The system still seems to deliver mail rapidly and the huge memory usage does not occur any longer.
2009-01-20 05:13:08 +00:00
pfelt 61182fdcf5 -- Fixed two memory leaks 2009-01-17 06:57:17 +00:00
pfelt 745b2df92c -- These files are no longer needed 2008-11-01 16:19:10 +00:00
pfelt f280eb8490 -- Fixed a bug where I was setting a character to null for string operations and not correctly setting it back when finished.
-- Fixed the envelope parser used to generate the replacement envelope on the new email.
-- (bugs submitted by Andrew Wafaa)
2008-10-26 04:59:27 +00:00
alexhudson 06013ebc60 Don't attempt to look for files on disk during REPAIR for object types that only exist in the database. 2008-10-17 10:47:22 +00:00
alexhudson d0ae6bc3a6 Make IMAP work with folders that have spaces in their names. 2008-10-17 10:31:54 +00:00
alexhudson 8e54ef5ab3 New store command 'REPAIR' to at least get broken stores consistent 2008-10-16 21:17:51 +00:00
alexhudson e31d7842fc Initial bits of store read-only support 2008-10-15 19:18:11 +00:00
alexhudson f231aeea79 Close remote SMTP connections even where the mail wasn't sent. 2008-10-15 11:55:06 +00:00
alexhudson f67fa7cfe9 Make smtpc work with "long banner" smtp servers. 2008-10-15 11:46:28 +00:00
alexhudson 8ff06fd1c4 Small fix to stop an infinite loop in the SMTP client. 2008-10-10 09:31:22 +00:00
alexhudson 90e8a95b6a Go back to previous libical API for header files since this seems to be 'right' for the future now... 2008-10-10 09:08:05 +00:00
alexhudson 07b8c90144 Stop attempting to cache SQL statements; we have a race in here which causes crashing. 2008-10-05 11:43:58 +00:00
pfelt 6c2350dcc8 -- added some debug logging
-- added bounce messages which should probably be fleshed out a bit
2008-10-02 04:14:34 +00:00
pfelt a477fc729a -- rewrite. We drop messages with viruses detected, however we do not yet send any notification in either direction of an infected mail. 2008-09-29 22:13:18 +00:00
alexhudson c8b76933bb Try to catch various crashes and log something to a file. Works for the queue, and possibly other agents if they use the main signal handler. 2008-09-22 20:00:41 +00:00
alexhudson 04c034b932 Make SMTP client take notice of remote server errors in the banner. 2008-09-14 16:28:58 +00:00
1817 changed files with 5103 additions and 424490 deletions
+77
View File
@@ -0,0 +1,77 @@
# Global build file for Bongo
project(bongo C)
# set version of cmake required, and module path
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(BONGO_V_MAJOR 0)
set(BONGO_V_MINOR 6)
set(BONGO_V_BUILD 0)
set(BONGO_V_STR "${BONGO_V_MAJOR}.${BONGO_V_MINOR}.${BONGO_V_BUILD}")
# arguments we can supply to the build system - TODO
set(BONGO_USER "root" CACHE STRING "User account Bongo should run under")
option(CONN_TRACE "Enable connection tracing" OFF)
include(cmake/BongoCompiler.cmake)
# find our various build requirements
include(cmake/Requirements.cmake)
# define RPATH for debug/etc. builds - allows us to install libraries
# in non-system location and the binaries still link to them
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# set up defines for build directories
include(cmake/DefineInstallationPaths.cmake)
include(cmake/Directories.cmake)
# any legacy defines which we want to get rid of eventually
include(cmake/Legacy.cmake)
# output header files etc. specifically configured for this build
configure_file(config.h.cmake include/config.h @ONLY)
configure_file(src/agents/store/create-store.s.cmake src/agents/store/createstore.s @ONLY)
# tell compiler where to find Bongo's header files
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
# now build our various libraries, agents, binaries.
# DO NOT ALTER (SO)VERSION ON LIBRARIES WITHOUT ASKING!
foreach (LIBRARY xpl streamio logging msgapi connio util json cal nmap)
add_subdirectory (src/libs/${LIBRARY})
set_target_properties(bongo${LIBRARY} PROPERTIES
SOVERSION 0
VERSION ${BONGO_V_STR}
)
endforeach (LIBRARY)
add_subdirectory(src/libs/python/libbongo)
add_subdirectory(src/libs/python/bongo)
foreach (AGENT antispam avirus imap pop queue rules smtp store)
add_subdirectory (src/agents/${AGENT})
endforeach (AGENT)
foreach (EXECUTABLE config manager testtool queuetool storetool sendmail backup)
add_subdirectory (src/apps/${EXECUTABLE})
endforeach (EXECUTABLE)
add_subdirectory (init)
# install various other files
install(DIRECTORY include/
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/bongo"
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE)
install(DIRECTORY zoneinfo
DESTINATION ${XPL_DEFAULT_DATA_DIR}
FILES_MATCHING PATTERN "*.zone"
PATTERN ".svn" EXCLUDE)
# include rules for make distribution tarballs
include(cmake/Distribution.cmake)
+47 -218
View File
@@ -1,234 +1,63 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
Initial Build Instructions
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
For more detailed instructions, you may wish to consult our website at
www.bongo-project.org.
CPU-COMPANY-SYSTEM
The first thing to do is create a new directory to do the build in: this
stops all the build files from littering the source tree. Assuming you're
in the Bongo source tree:
where SYSTEM can have one of these forms:
$ mkdir build
$ cd build/
OS KERNEL-OS
Now we need to configure the build. There are two ways of doing this, and
you can use both! One way is good to start off, the other way is good for
tweaking. Youll see what I mean, but lets start with the initial
configuration. A good invocation might be something like:
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/bongo -DBONGO_USER=bongo \
-DCMAKE_BUILD_TYPE=Debug -DDEBUG=On
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
The first argument points to the Bongo source directory. Because we made a
build directory in the source tree and went into it, were just pointing at
our parent directory. Then come some other options. Every option is prefixed
with “-D”, and some of them are CMake options and others are Bongo options.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
In full:
Sharing Defaults
================
* CMAKE_INSTALL_PREFIX: where we want to install to. I use /tmp/build for
testing, and /usr/local/bongo when I want to run it in production.
* BONGO_USER: which user you want Bongo to run as. I use my user account
for testing, “bongo” for production. You can also run as “root” if
brave (not recommended!)
* CMAKE_BUILD_TYPE: set this to Debug to generate information for gdb,
otherwise leave this option out.
* DEBUG: enable code paths which generate debugging messages. Both this
option and the previous are for either advanced users or developers,
really.
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
There are other options to the Bongo build, but these are the main ones.
However, once youve configured Bongo, you may want to tweak something:
perhaps turn on debugging, or change one of the file paths, or something
different. The easiest way to do that is simply:
Defining Variables
==================
$ ccmake ./
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
Note that its “ccmake”, not “cmake”. This starts an interactive application
where you can change each configuration item. You point it at the build
directory, not the source, and it gives you all the various tweakable options.
Youll see that they are the same options that we pass to cmake - and indeed,
you can pass them to cmake!
./configure CC=/usr/local2/bin/gcc
Theres even an advanced mode with even more knobs (press t). When youre
done, press c to configure the build and then q to quit.
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
Once you have configured the build, you have access to the usual make commands:
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--with-audit'
Enable logging support for Novell Audit. You will need to provide
certificate and private key files "bongocert.pem" and "bongopkey.pem"
in SYSCONFDIR/bongo/ for authentication against Audit.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
$ make
$ make install
$ make clean
The first builds Bongo, the second installs it to your prefix, the last
removes the intermediate compilation files.
-210
View File
@@ -1,210 +0,0 @@
#
# This is a non-recursive (except for imports) automake file.
#
# The style was inspired by Robert Collins, as mentioned here:
#
# http://sources.redhat.com/ml/automake/2001-08/msg00061.html
#
# And the original Recursive Make Considered Harmful:
#
# http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html
#
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4 -I macros
NULL =
bin_PROGRAMS =
sbin_PROGRAMS =
noinst_PROGRAMS =
check_PROGRAMS =
sbin_SCRIPTS =
dist_sbin_SCRIPTS =
dist_noinst_SCRIPTS =
dist_pkglibexec_SCRIPTS =
lib_LTLIBRARIES =
nobase_dist_pkgdata_DATA =
dist_noinst_DATA =
noinst_DATA =
noinst_HEADERS =
BUILT_SOURCES =
CLEANFILES =
TESTS =
AM_CPPFLAGS = $(ALL_CFLAGS) \
$(NO_POINTER_SIGN_WARNINGS) \
$(PTHREAD_CFLAGS) \
-I$(top_srcdir)/include $(GNUTLS_CFLAGS)
EXTRA_DIST = \
config.rpath \
bongo.pc.in \
HACKING \
include/bongo-buildinfo.h \
init/bongo.init.fc4.in \
init/bongo.init.sles9.in \
init/bongo.init.suse10.in \
init/bongo.xml.solaris-smf \
init/http-bongo.xml.solaris-smf \
init/http-bongo.solaris-smf.in \
init/svc-bongo.solaris-smf.in \
mkinstalldirs
localedir = $(datadir)/locale
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = bongo.pc
pkglibexecdir = $(libexecdir)/$(PACKAGE)
install-data-hook::
$(mkinstalldirs) $(DESTDIR)$(XPL_DEFAULT_CACHE_DIR)
SUBDIRS = \
$(IMPORT_SUBDIRS) \
import/log4c \
po
doxygen/html:
if test "$(DOXYGEN)" != NO_DOXYGEN; then \
$(DOXYGEN) ./doxygen/doxygen.conf; \
else \
echo "No doxygen available"; \
fi
doxygen/diagrams:
mkdir -p doxygen/diagrams
find src/ -name \*.dot -printf "-o doxygen/diagrams/%f %h/%f" | xargs -l1 dot -Tpng -Nfontname="Bitstream Vera Sans" -Nfontsize=12
for i in doxygen/diagrams/*.dot; do mv "$$i" "$${i/.dot}".png; done
docs: doxygen/html doxygen/diagrams
clean: clean-recursive clean-docs
clean-docs:
rm -rf ./doxygen/html ./doxygen/latex ./doxygen/diagrams
# disabled agents
# src/agents/mailprox
# src/agents/rules
# src/agents/calcmd
include_subdirs = \
include \
src/libs/xpl \
src/libs/xpl/tests \
src/libs/memmgr \
src/libs/bongoutil \
src/libs/bongoutil/tests \
src/libs/connio \
src/libs/connio/tests \
src/libs/json \
src/libs/logger \
src/libs/streamio \
src/libs/streamio/codec \
src/libs/cal \
src/libs/cal/tests \
src/libs/nmap \
src/libs/msgapi \
src/libs/calcmd \
src/libs/calcmd/tests \
src/libs/python \
src/libs/python/libbongo \
src/agents/alarm \
src/agents/antispam \
src/agents/avirus \
src/agents/collector \
src/agents/generic \
src/agents/imap \
src/agents/imap/tests \
src/agents/itip \
src/agents/pop \
src/agents/queue \
src/agents/smtp \
src/agents/store \
src/agents/store/tests \
src/apps/backup \
src/apps/config \
src/apps/manager \
src/apps/sendmail \
src/apps/queuetool \
src/apps/storetool \
src/apps/storetool/demo \
src/apps/testtool \
src/www \
zoneinfo \
man \
po
# src/apps/migrate
DIST_SUBDIRS = $(SUBDIRS) $(include_subdirs)
include include/Bongo.rules
include src/libs/xpl/Bongo.rules
include src/libs/xpl/tests/Bongo.rules
include src/libs/memmgr/Bongo.rules
include src/libs/bongoutil/Bongo.rules
include src/libs/bongoutil/tests/Bongo.rules
include src/libs/connio/Bongo.rules
include src/libs/connio/tests/Bongo.rules
include src/libs/json/Bongo.rules
include src/libs/logger/Bongo.rules
include src/libs/streamio/Bongo.rules
include src/libs/streamio/codec/Bongo.rules
include src/libs/cal/Bongo.rules
include src/libs/cal/tests/Bongo.rules
include src/libs/nmap/Bongo.rules
include src/libs/msgapi/Bongo.rules
include src/libs/calcmd/Bongo.rules
include src/libs/calcmd/tests/Bongo.rules
include src/libs/python/Bongo.rules
include src/libs/python/libbongo/Bongo.rules
include src/agents/alarm/Bongo.rules
include src/agents/antispam/Bongo.rules
include src/agents/avirus/Bongo.rules
#include src/agents/calcmd/Bongo.rules
include src/agents/collector/Bongo.rules
include src/agents/generic/Bongo.rules
include src/agents/imap/Bongo.rules
include src/agents/imap/tests/Bongo.rules
include src/agents/itip/Bongo.rules
#include src/agents/mailprox/Bongo.rules
include src/agents/pop/Bongo.rules
include src/agents/queue/Bongo.rules
#include src/agents/rules/Bongo.rules
include src/agents/smtp/Bongo.rules
include src/agents/store/Bongo.rules
include src/agents/store/tests/Bongo.rules
include src/apps/backup/Bongo.rules
include src/apps/config/Bongo.rules
include src/apps/manager/Bongo.rules
include src/apps/sendmail/Bongo.rules
# include src/apps/migrate/Bongo.rules
include src/apps/queuetool/Bongo.rules
include src/apps/storetool/Bongo.rules
include src/apps/storetool/demo/Bongo.rules
include src/apps/testtool/Bongo.rules
include src/www/Bongo.rules
include zoneinfo/Bongo.rules
include man/Bongo.rules
include po/Bongo.rules
update-makefiles:
@for dir in $(include_subdirs) ; do \
echo " cp $(top_srcdir)/Makefile.am.subdir $(top_srcdir)/$$dir/Makefile.am" ; \
cp "$(top_srcdir)/Makefile.am.subdir" "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
if test "$$dir" == "po" ; then \
echo "" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
echo "distclean:" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
fi ; \
done
-17
View File
@@ -1,17 +0,0 @@
# -*- Makefile -*-
#
# Do not edit!
#
# (unless this is Makefile.am.subdir)
#
# This file is a copy of the toplevel Makefile.am.subdir. If changes
# need to be made, edit that file, and make update-makefiles, and
# check the new files in.
#
# This is a skeletal automake file. The real automake fules for
# building the targets for this directory can be found in the
# Bongo.rules file. This file is simply here so that 'make all' can
# work in each subdirectory.
all clean install:
@cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@
-119
View File
@@ -1,119 +0,0 @@
01: Currently the NetMail agents signal handling for SIGHUP is not
fully implemented. We need to establish uniform signal handling
for SIGHUP, SIGUSR1 and SIGUSR2 as appropriate.
02: An MDBPAM driver would be more appropriate than the simple MDBFIle
driver.
03: The MDBFile driver is not multi-app multi-thread safe for read and
write access.
04: The anti-virus agent needs to use an open source anti-virus engine
as an example.
05: Add backwards API compatibility for old SDK based components.
06: Instrument use of OpenLDAP in place of our old LDAP library.
07: Run as non-root user.
08: src/agents/nmap/nmapc.h is empty
09: The managed client library needs to use the connection manager library.
10: We need to identify and resolve 'fixme' comments.
10: The connection management library needs:
a: exclusive BUFSIZE defintion as it is defined in most private
header files.
b: exclusive MTU definition as it is defined in most private
header files.
11: Source code scrubbing definition:
: DOS2Unix the source and make files.
: Replace TAB characters with 4 spaces.
: Ensure that the first directive in the source files is:
#include <config.h>
: Replace BUFSIZE with CONN_BUFSIZE as defined in connio.h
: Remove BUFSIZE definitions from source files.
: Replace MTU with CONN_TCP_MTU as defined in connio.h
: Remove MTU definitions from source files.
: Remove NMLOGID_H_NEED_LOGGING_KEY and NMLOGID_H_NEED_LOGGING_CERT
as they are now handled by the logging library.
: Re-format the source files.
: Defines should be grouped together; preferrable in the private
header file as appropriate.
: The ChopNL macro is repeatedly defined; this definition exists in
connio.h as CHOP_NEWLINE; convert usage.
Should this macro be in the cross platform headers?
: The SetPtrToValue macro is repeatedly defined across binaries;
however, it does not appear in any source file?
This definition exists in connio.h at this time as
SET_POINTER_TO_VALUE.
Should this macro be retained in the cross platform headers?
: Strucuture definitions should be grouped together; preferrably in
the private header file as appropriate.
: Move global variables to a binary name based structure and:
If single source file; leave structure definition in that file.
If multiple source files; move structure definition to the
private header file; setup an extern of the structue which
should be in the main source file.
Globals for thread ID's are commonly defined as 'int' and not
XplThreadID. Convert definitions such as:
int Tid;
int TGid;
to:
struct {
XplThreadID main;
XplThreadID group;
} id;
Adjust global variable names and usage appropriately.
: Base64Chars[], DecodeBase64() and EncodeBase64() are commonly
occurring in the binaries. Should this be moved to a utility
library?
: Remove inappropriate code comments and reformat those left behind
as directed.
: Convert BUG comments to fixme.
: For defined strings; use sizeof(string) - 1 in place of a defined length.
: Remove old connection i/o handling routines and definitions as
directed (using little optimizations along the way?):
XPLIPReadSSL
XPLIPWriteSSL
IOFuncs
DoNMAPWrite
DoNMAPRead
DoClientWrite
DoClientRead
FlushClient
SendClient
SendNMAPServer
GetNMAPAnswer
GetNMAPAnswerLen
ConnectUserToNMAPServer
EndClientConnection
12: We need to resolve PRODUCT_VERSION definitions and use.
13: Improve client connection state processing
-260
View File
@@ -1,260 +0,0 @@
dnl as-ac-expand.m4 0.1.0
dnl autostars m4 macro for expanding directories using configure's prefix
dnl thomas@apestaart.org
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var"="x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
dnl also defines GSTUFF_PKG_ERRORS on error
AC_DEFUN([PKG_CHECK_MODULES], [
succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
AC_MSG_CHECKING(for $2)
if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
succeeded=yes
AC_MSG_CHECKING($1_CFLAGS)
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
AC_MSG_RESULT($$1_CFLAGS)
AC_MSG_CHECKING($1_LIBS)
$1_LIBS=`$PKG_CONFIG --libs "$2"`
AC_MSG_RESULT($$1_LIBS)
else
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
ifelse([$4], ,echo $$1_PKG_ERRORS,)
fi
AC_SUBST($1_CFLAGS)
AC_SUBST($1_LIBS)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
ifelse([$3], , :, [$3])
else
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
fi
])
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])
dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
dnl
AC_DEFUN([AM_PATH_CHECK],
[
AC_ARG_WITH([check],
[ --with-check=PATH prefix where check is installed [default=auto]])
min_check_version=ifelse([$1], ,0.8.2,$1)
AC_MSG_CHECKING(for check - version >= $min_check_version)
if test x$with_check = xno; then
AC_MSG_RESULT(disabled)
ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3])
else
if test "x$with_check" != x; then
CHECK_CFLAGS="-I$with_check/include"
CHECK_LIBS="-L$with_check/lib -lcheck"
else
CHECK_CFLAGS=""
CHECK_LIBS="-lcheck"
fi
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $CHECK_CFLAGS"
LIBS="$CHECK_LIBS $LIBS"
rm -f conf.check-test
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <check.h>
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.check-test");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = strdup("$min_check_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_check_version");
return 1;
}
if ((CHECK_MAJOR_VERSION != check_major_version) ||
(CHECK_MINOR_VERSION != check_minor_version) ||
(CHECK_MICRO_VERSION != check_micro_version))
{
printf("\n*** The check header file (version %d.%d.%d) does not match\n",
CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION);
printf("*** the check library (version %d.%d.%d).\n",
check_major_version, check_minor_version, check_micro_version);
return 1;
}
if ((check_major_version > major) ||
((check_major_version == major) && (check_minor_version > minor)) ||
((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of check (%d.%d.%d) was found.\n",
check_major_version, check_minor_version, check_micro_version);
printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro);
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the check library and header\n");
printf("*** file is being found. Rerun configure with the --with-check=PATH option\n");
printf("*** to specify the prefix where the correct version was installed.\n");
}
return 1;
}
],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "x$no_check" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test -f conf.check-test ; then
:
else
echo "*** Could not run check test program, checking why..."
CFLAGS="$CFLAGS $CHECK_CFLAGS"
LIBS="$CHECK_LIBS $LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <check.h>
], , [ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding check. You'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for"
echo "*** the exact error that occured." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
CHECK_CFLAGS=""
CHECK_LIBS=""
rm -f conf.check-test
ifelse([$3], , AC_MSG_ERROR([check not found]), [$3])
fi
AC_SUBST(CHECK_CFLAGS)
AC_SUBST(CHECK_LIBS)
rm -f conf.check-test
fi
])
-480
View File
@@ -1,480 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
#name of package
PKG_NAME=Bongo
srcdir=${srcdir:-.}
# default version requirements ...
REQUIRED_AUTOCONF_VERSION=${REQUIRED_AUTOCONF_VERSION:-2.53}
REQUIRED_AUTOMAKE_VERSION=${REQUIRED_AUTOMAKE_VERSION:-1.9}
REQUIRED_LIBTOOL_VERSION=${REQUIRED_LIBTOOL_VERSION:-1.4.3}
REQUIRED_GETTEXT_VERSION=${REQUIRED_GETTEXT_VERSION:-0.10.40}
REQUIRED_GLIB_GETTEXT_VERSION=${REQUIRED_GLIB_GETTEXT_VERSION:-2.2.0}
REQUIRED_INTLTOOL_VERSION=${REQUIRED_INTLTOOL_VERSION:-0.25}
REQUIRED_PKG_CONFIG_VERSION=${REQUIRED_PKG_CONFIG_VERSION:-0.14.0}
REQUIRED_GTK_DOC_VERSION=${REQUIRED_GTK_DOC_VERSION:-1.0}
REQUIRED_DOC_COMMON_VERSION=${REQUIRED_DOC_COMMON_VERSION:-2.3.0}
# a list of required m4 macros. Package can set an initial value
REQUIRED_M4MACROS=${REQUIRED_M4MACROS:-}
FORBIDDEN_M4MACROS=${FORBIDDEN_M4MACROS:-}
# Not all echo versions allow -n, so we check what is possible. This test is
# based on the one in autoconf.
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ;;
*c*,* ) ECHO_N=-n ;;
*) ECHO_N= ;;
esac
# if GNOME2_DIR or GNOME2_PATH is set, modify ACLOCAL_FLAGS ...
# NOTE: GNOME2_DIR is deprecated (as of Jan 2004), but is left here for
# backwards-compatibility. You should be using GNOME2_PATH, since that is also
# understood by libraries such as libgnome.
if [ -n "$GNOME2_DIR" ]; then
echo "Using GNOME2_DIR is deprecated in gnome-common."
echo "Please use GNOME2_PATH instead (for compatibility with other GNOME pieces)."
ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
LD_LIBRARY_PATH_ADD=
for D in $P/lib* ; do
LD_LIBRARY_PATH_ADD="${LD_LIBRARY_PATH_ADD:+$LD_LIBRARY_PATH_ADD:}$GNOME2_DIR"
done
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_ADD${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
PATH="$GNOME2_DIR/bin:$PATH"
export PATH
export LD_LIBRARY_PATH
else
if [ -n "$GNOME2_PATH" ]; then
IFS="$IFS:"
LD_LIBRARY_PATH_ADD=
for P in $GNOME2_PATH ; do
if [ -d $P/share/aclocal ] ; then
ACLOCAL_FLAGS="-I $P/share/aclocal $ACLOCAL_FLAGS"
fi
for D in $P/lib* ; do
LD_LIBRARY_PATH_ADD="${LD_LIBRARY_PATH_ADD:+$LD_LIBRARY_PATH_ADD:}$D"
done
PATH="$P/bin:$PATH"
done
IFS="${IFS%:}"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_ADD${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export PATH
export LD_LIBRARY_PATH
fi
fi
# some terminal codes ...
boldface="`tput bold 2>/dev/null`"
normal="`tput sgr0 2>/dev/null`"
printbold() {
echo $ECHO_N "$boldface"
echo "$@"
echo $ECHO_N "$normal"
}
printerr() {
echo "$@" >&2
}
# Usage:
# compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION
compare_versions() {
ch_min_version=$1
ch_actual_version=$2
ch_status=0
IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
set $ch_actual_version
for ch_min in $ch_min_version; do
ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
if [ -z "$ch_min" ]; then break; fi
if [ -z "$ch_cur" ]; then ch_status=1; break; fi
if [ $ch_cur -gt $ch_min ]; then break; fi
if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
done
IFS="$ch_save_IFS"
return $ch_status
}
# Usage:
# version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
# checks to see if the package is available
version_check() {
vc_package=$1
vc_variable=$2
vc_checkprogs=$3
vc_min_version=$4
vc_source=$5
vc_status=1
vc_checkprog=`eval echo "\\$$vc_variable"`
if [ -n "$vc_checkprog" ]; then
printbold "using $vc_checkprog for $vc_package"
return 0
fi
printbold "checking for $vc_package >= $vc_min_version..."
for vc_checkprog in $vc_checkprogs; do
echo $ECHO_N " testing $vc_checkprog... "
if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
vc_actual_version=`$vc_checkprog --version | head -n 1 | \
sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
if compare_versions $vc_min_version $vc_actual_version; then
echo "found $vc_actual_version"
# set variable
eval "$vc_variable=$vc_checkprog"
vc_status=0
break
else
echo "too old (found version $vc_actual_version)"
fi
else
echo "not found."
fi
done
if [ "$vc_status" != 0 ]; then
printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
printerr " to build $PKG_NAME. Download the appropriate package for"
printerr " from your distribution or get the source tarball at"
printerr " $vc_source"
printerr
fi
return $vc_status
}
# Usage:
# require_m4macro filename.m4
# adds filename.m4 to the list of required macros
require_m4macro() {
case "$REQUIRED_M4MACROS" in
$1\ * | *\ $1\ * | *\ $1) ;;
*) REQUIRED_M4MACROS="$REQUIRED_M4MACROS $1" ;;
esac
}
forbid_m4macro() {
case "$FORBIDDEN_M4MACROS" in
$1\ * | *\ $1\ * | *\ $1) ;;
*) FORBIDDEN_M4MACROS="$FORBIDDEN_M4MACROS $1" ;;
esac
}
# Usage:
# check_m4macros
# Checks that all the requested macro files are in the aclocal macro path
# Uses REQUIRED_M4MACROS and ACLOCAL variables.
check_m4macros() {
# construct list of macro directories
cm_macrodirs="`$ACLOCAL --print-ac-dir`"
if [ `uname` = "FreeBSD" ]; then
ACLOCAL_FLAGS="-I /usr/local/share/aclocal"
fi
set - $ACLOCAL_FLAGS
while [ $# -gt 0 ]; do
if [ "$1" = "-I" ]; then
cm_macrodirs="$cm_macrodirs $2"
shift
fi
shift
done
cm_status=0
if [ -n "$REQUIRED_M4MACROS" ]; then
printbold "Checking for required M4 macros..."
# check that each macro file is in one of the macro dirs
for cm_macro in $REQUIRED_M4MACROS; do
cm_macrofound=false
for cm_dir in $cm_macrodirs; do
if [ -f "$cm_dir/$cm_macro" ]; then
cm_macrofound=true
break
fi
# The macro dir in Cygwin environments may contain a file
# called dirlist containing other directories to look in.
if [ -f "$cm_dir/dirlist" ]; then
for cm_otherdir in `cat $cm_dir/dirlist`; do
if [ -f "$cm_otherdir/$cm_macro" ]; then
cm_macrofound=true
break
fi
done
fi
done
if $cm_macrofound; then
:
else
printerr " $cm_macro not found"
cm_status=1
fi
done
fi
if [ -n "$FORBIDDEN_M4MACROS" ]; then
printbold "Checking for forbidden M4 macros..."
# check that each macro file is in one of the macro dirs
for cm_macro in $FORBIDDEN_M4MACROS; do
cm_macrofound=false
for cm_dir in $cm_macrodirs; do
if [ -f "$cm_dir/$cm_macro" ]; then
cm_macrofound=true
break
fi
done
if $cm_macrofound; then
printerr " $cm_macro found (should be cleared from macros dir)"
cm_status=1
fi
done
fi
if [ "$cm_status" != 0 ]; then
printerr "***Error***: some autoconf macros required to build $PKG_NAME"
printerr " were not found in your aclocal path, or some forbidden"
printerr " macros were found. Perhaps you need to adjust your"
printerr " ACLOCAL_FLAGS?"
printerr
fi
return $cm_status
}
# try to catch the case where the macros2/ directory hasn't been cleared out.
forbid_m4macro gnome-cxx-check.m4
want_libtool=false
want_gettext=false
want_glib_gettext=false
want_intltool=false
want_pkg_config=false
want_gtk_doc=false
configure_files="`find $srcdir -name 'bongo-*' -prune -name '{arch}' -prune -o -name configure.ac -print -o -name configure.in -print`"
for configure_ac in $configure_files; do
if grep "^A[CM]_PROG_LIBTOOL" $configure_ac >/dev/null; then
want_libtool=true
fi
if grep "^AM_GNU_GETTEXT" $configure_ac >/dev/null; then
want_gettext=true
fi
if grep "^AM_GLIB_GNU_GETTEXT" $configure_ac >/dev/null; then
want_glib_gettext=true
fi
if grep "^AC_PROG_INTLTOOL" $configure_ac >/dev/null; then
want_intltool=true
fi
if grep "^PKG_CHECK_MODULES" $configure_ac >/dev/null; then
want_pkg_config=true
fi
if grep "^GTK_DOC_CHECK" $configure_ac >/dev/null; then
want_gtk_doc=true
fi
done
DIE=0
#tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
WANT_AUTOCONF_2_5=1
export WANT_AUTOCONF_2_5
version_check autoconf AUTOCONF 'autoconf2.50 autoconf autoconf-2.59 autoconf259' $REQUIRED_AUTOCONF_VERSION \
"http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTOCONF_VERSION.tar.gz" || DIE=1
AUTOHEADER=`echo $AUTOCONF | sed s/autoconf/autoheader/`
case $REQUIRED_AUTOMAKE_VERSION in
1.7*) automake_progs="automake-1.7 automake-1.8 automake-1.9 automake19 automake-1.10" ;;
1.8*) automake_progs="automake-1.8 automake-1.9 automake19 automake-1.10" ;;
1.9*) automake_progs="automake-1.9 automake19 automake-1.10" ;;
esac
version_check automake AUTOMAKE "$automake_progs" $REQUIRED_AUTOMAKE_VERSION \
"http://ftp.gnu.org/pub/gnu/automake/automake-$REQUIRED_AUTOMAKE_VERSION.tar.gz" || DIE=1
ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
if $want_libtool; then
version_check libtool LIBTOOLIZE 'libtoolize libtoolize15 glibtoolize' $REQUIRED_LIBTOOL_VERSION \
"http://ftp.gnu.org/pub/gnu/libtool/libtool-$REQUIRED_LIBTOOL_VERSION.tar.gz" || DIE=1
# if [ `uname` = "FreeBSD" ]; then
# require_m4macro libtool15.m4
# fi
require_m4macro libtool.m4
fi
if $want_gettext; then
version_check gettext GETTEXTIZE gettextize $REQUIRED_GETTEXT_VERSION \
"http://ftp.gnu.org/pub/gnu/gettext/gettext-$REQUIRED_GETTEXT_VERSION.tar.gz" || DIE=1
require_m4macro gettext.m4
fi
if $want_glib_gettext; then
version_check glib-gettext GLIB_GETTEXTIZE glib-gettextize $REQUIRED_GLIB_GETTEXT_VERSION \
"ftp://ftp.gtk.org/pub/gtk/v2.2/glib-$REQUIRED_GLIB_GETTEXT_VERSION.tar.gz" || DIE=1
require_m4macro glib-gettext.m4
fi
if $want_intltool; then
version_check intltool INTLTOOLIZE intltoolize $REQUIRED_INTLTOOL_VERSION \
"http://ftp.gnome.org/pub/GNOME/sources/intltool/" || DIE=1
require_m4macro intltool.m4
fi
if $want_pkg_config; then
version_check pkg-config PKG_CONFIG pkg-config $REQUIRED_PKG_CONFIG_VERSION \
"'http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-$REQUIRED_PKG_CONFIG_VERSION.tar.gz" || DIE=1
require_m4macro pkg.m4
fi
if $want_gtk_doc; then
version_check gtk-doc GTKDOCIZE gtkdocize $REQUIRED_GTK_DOC_VERSION \
"http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/" || DIE=1
require_m4macro gtk-doc.m4
fi
if [ "x$USE_COMMON_DOC_BUILD" = "xyes" ]; then
version_check gnome-common DOC_COMMON gnome-doc-common \
$REQUIRED_DOC_COMMON_VERSION " " || DIE=1
fi
check_m4macros || DIE=1
if [ "$DIE" -eq 1 ]; then
exit 1
fi
if test -z "$*"; then
printerr "**Warning**: I am going to run \`configure' with no arguments."
printerr "If you wish to pass any to it, please specify them on the"
printerr \`$0\'" command line."
printerr
fi
for arg in $@; do
case $arg in
--with-clucene=*import*)
rm -f import/clucene/NO-AUTO-GEN
;;
--with-clucene=*)
touch import/clucene/NO-AUTO-GEN
echo "Flagging import/clucene as no auto-gen as source is external"
;;
--with-sqlite3=*import*)
rm -f import/sqlite3/NO-AUTO-GEN
;;
--with-sqlite3=*)
touch import/sqlite3/NO-AUTO-GEN
echo "Flagging import/sqlite3 as no auto-gen as source is external"
;;
esac
done
topdir=`pwd`
for configure_ac in $configure_files; do
dirname=`dirname $configure_ac`
basename=`basename $configure_ac`
if test -f $dirname/NO-AUTO-GEN; then
echo skipping $dirname -- flagged as no auto-gen
else
printbold "Processing $configure_ac"
cd $dirname
# Note that the order these tools are called should match what
# autoconf's "autoupdate" package does. See bug 138584 for
# details.
# programs that might install new macros get run before aclocal
if grep "^A[CM]_PROG_LIBTOOL" $basename >/dev/null; then
printbold "Running $LIBTOOLIZE..."
$LIBTOOLIZE --force || exit 1
fi
if grep "^AM_GLIB_GNU_GETTEXT" $basename >/dev/null; then
printbold "Running $GLIB_GETTEXTIZE... Ignore non-fatal messages."
echo "no" | $GLIB_GETTEXTIZE --force --copy || exit 1
elif grep "^AM_GNU_GETTEXT" $basename >/dev/null; then
if grep "^AM_GNU_GETTEXT_VERSION" $basename > /dev/null; then
printbold "Running autopoint..."
autopoint --force || exit 1
else
printbold "Running $GETTEXTIZE... Ignore non-fatal messages."
echo "no" | $GETTEXTIZE --force --copy --no-changelog || exit 1
fi
fi
if grep "^AC_PROG_INTLTOOL" $basename >/dev/null; then
printbold "Running $INTLTOOLIZE..."
$INTLTOOLIZE --force --automake || exit 1
fi
if grep "^GTK_DOC_CHECK" $basename >/dev/null; then
printbold "Running $GTKDOCIZE..."
$GTKDOCIZE || exit 1
fi
if [ "x$USE_COMMON_DOC_BUILD" = "xyes" ]; then
printbold "Running gnome-doc-common..."
gnome-doc-common --copy || exit 1
fi
# Now run aclocal to pull in any additional macros needed
aclocalinclude="$ACLOCAL_FLAGS"
if test -d m4; then
aclocalinclude="$aclocalinclude -I m4"
fi
if test -d macros; then
aclocalinclude="$aclocalinclude -I macros"
fi
echo $aclocalinclude
printbold "Running $ACLOCAL $aclocalinclude ..."
$ACLOCAL $aclocalinclude || exit 1
if grep "GNOME_AUTOGEN_OBSOLETE" aclocal.m4 >/dev/null; then
printerr "*** obsolete gnome macros were used in $configure_ac"
fi
# Now that all the macros are sorted, run autoconf and autoheader ...
printbold "Running $AUTOCONF..."
$AUTOCONF || exit 1
if grep "^A[CM]_CONFIG_HEADER" $basename >/dev/null; then
printbold "Running $AUTOHEADER..."
$AUTOHEADER || exit 1
# this prevents automake from thinking config.h.in is out of
# date, since autoheader doesn't touch the file if it doesn't
# change.
test -f config.h.in && touch config.h.in
fi
if test -f Makefile.am; then
# Finally, run automake to create the makefiles ...
printbold "Running $AUTOMAKE..."
$AUTOMAKE --gnu --add-missing || exit 1
fi
cd "$topdir"
fi
done
# remove any flags which tell us not to autogen things
#rm -f import/clucene/NO-AUTO-GEN
#rm -f import/sqlite3/NO-AUTO-GEN
SVNREV="`svnversion . 2>/dev/null`"
if test x$SVNREV = x; then
echo Unable to discern build version
echo \#define BONGO_BUILD_BRANCH \"unknown\" > ./include/bongo-buildinfo.h
echo \#define BONGO_BUILD_VSTR \"\" >> ./include/bongo-buildinfo.h
echo \#define BONGO_BUILD_VER \"0\" >> ./include/bongo-buildinfo.h
else
echo SVN Rev at $SVNREV
echo \#define BONGO_BUILD_BRANCH \"trunk\" > ./include/bongo-buildinfo.h
echo \#define BONGO_BUILD_VSTR \"r\" >> ./include/bongo-buildinfo.h
echo \#define BONGO_BUILD_VER \"$SVNREV\" >> ./include/bongo-buildinfo.h
fi
conf_flags="--enable-maintainer-mode"
if test x$NOCONFIGURE = x; then
printbold Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
|| exit 1
echo Now type \`make\' to compile $PKG_NAME
else
echo Skipping configure process.
fi
-11
View File
@@ -1,11 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@/bongo
Name: Bongo
Description: A fast and scalable email and calendar server
Version: @VERSION@
Libs: -L${libdir} -lbongostreamio -lbongomanagement -lbongonmap -lbongoconnmgr -lbongomsgapi -lbongomdb -lbongologger -lbongoconnio -lbongoutil -lbongomemmgr -lbongoxpl -lbongocalcmd -lbongocal -lbongo-json
Cflags: -I${includedir}
Requires: gnutls
+30
View File
@@ -0,0 +1,30 @@
# function to attempt to turn on as many security flags as possible
# by default, we turn on as much as possible
include(CheckCCompilerFlag)
option(BONGO_SECURITY "Enable compiler flags which help protect against attacks" ON)
if (BONGO_SECURITY)
# check for -lssp ?
# check for -fstack-protector
check_c_compiler_flag (-fstack-protector-all GCC_STACK_PROTECTOR_ALL)
if (GCC_STACK_PROTECTOR_ALL)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all" PARENT_SCOPE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all" PARENT_SCOPE)
endif (GCC_STACK_PROTECTOR_ALL)
endif (BONGO_SECURITY)
option(DEBUG "Enable debugging infrastructure" OFF)
if (DEBUG)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -g3 -ggdb -O0" PARENT_SCOPE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -g3 -ggdb -O0" PARENT_SCOPE)
endif (DEBUG)
option(STRICTCOMPILE "Enable strict compilation rules" ON)
function (StrictCompile)
if (STRICTCOMPILE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -std=c99 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE" PARENT_SCOPE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -std=c++98 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE" PARENT_SCOPE)
endif (STRICTCOMPILE)
endfunction (StrictCompile)
+130
View File
@@ -0,0 +1,130 @@
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (UNIX)
IF (NOT APPLICATION_NAME)
MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME")
SET(APPLICATION_NAME ${PROJECT_NAME})
ENDIF (NOT APPLICATION_NAME)
# Suffix for Linux
SET(LIB_SUFFIX
CACHE STRING "Define suffix of directory name (32/64)"
)
SET(EXEC_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}"
CACHE PATH "Base directory for executables and libraries"
)
SET(SHARE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}/share"
CACHE PATH "Base directory for files which go to share/"
)
SET(DATA_INSTALL_PREFIX
"${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}"
CACHE PATH "The parent directory where applications can install their data")
# The following are directories where stuff will be installed to
SET(BIN_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/bin"
CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)"
)
SET(SBIN_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/sbin"
CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)"
)
SET(LIB_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)"
)
SET(LIBEXEC_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/libexec"
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)"
)
SET(PLUGIN_INSTALL_DIR
"${LIB_INSTALL_DIR}/${APPLICATION_NAME}"
CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})"
)
SET(INCLUDE_INSTALL_DIR
"${CMAKE_INSTALL_PREFIX}/include"
CACHE PATH "The subdirectory to the header prefix (default prefix/include)"
)
SET(DATA_INSTALL_DIR
"${DATA_INSTALL_PREFIX}"
CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_NAME})"
)
SET(HTML_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/doc/HTML"
CACHE PATH "The HTML install dir for documentation (default data/doc/html)"
)
SET(ICON_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/icons"
CACHE PATH "The icon install dir (default data/icons/)"
)
SET(SOUND_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/sounds"
CACHE PATH "The install dir for sound files (default data/sounds)"
)
SET(LOCALE_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/locale"
CACHE PATH "The install dir for translations (default prefix/share/locale)"
)
SET(XDG_APPS_DIR
"${SHARE_INSTALL_PREFIX}/applications/"
CACHE PATH "The XDG apps dir"
)
SET(XDG_DIRECTORY_DIR
"${SHARE_INSTALL_PREFIX}/desktop-directories"
CACHE PATH "The XDG directory"
)
SET(SYSCONF_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/etc"
CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)"
)
SET(MAN_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/man"
CACHE PATH "The ${APPLICATION_NAME} man install dir (default prefix/man)"
)
SET(INFO_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/info"
CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)"
)
endif (UNIX)
if (WIN32)
# Same same
set(BIN_INSTALL_DIR "." CACHE PATH "-")
set(SBIN_INSTALL_DIR "." CACHE PATH "-")
set(LIB_INSTALL_DIR "lib" CACHE PATH "-")
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-")
set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-")
set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-")
set(ICON_INSTALL_DIR "." CACHE PATH "-")
set(SOUND_INSTALL_DIR "." CACHE PATH "-")
set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-")
endif (WIN32)
+40
View File
@@ -0,0 +1,40 @@
# various directory definitions we use throughout Bongo
# 'default' locations for where objects get built
set(BINDIR ${PROJECT_BINARY_DIR}/bin)
set(SBINDIR ${PROJECT_BINARY_DIR}/sbin)
set(LIBDIR ${LIBRARY_OUTPUT_PATH})
set(LIBEXECDIR ${PROJECT_BINARY_DIR}/libexec)
set(DATAROOTDIR ${PROJECT_BINARY_DIR}/share)
set(DATADIR ${PROJECT_BINARY_DIR}/share)
set(LOCALSTATEDIR ${PROJECT_BINARY_DIR}/var)
set(INCLUDEDIR ${PROJECT_BINARY_DIR}/include)
# various paths for where objects get installed / work from
set(XPL_DEFAULT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/bongo)
set(XPL_DEFAULT_STATE_DIR ${CMAKE_INSTALL_PREFIX}/var/bongo)
set(XPL_DEFAULT_BIN_DIR ${CMAKE_INSTALL_PREFIX}/sbin)
set(XPL_DEFAULT_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
set(XPL_DEFAULT_CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc/bongo)
set(XPL_DEFAULT_NLS_DIR ${CMAKE_INSTALL_PREFIX}/share/bongo/nls)
set(XPL_DEFAULT_DBF_DIR ${XPL_DEFAULT_STATE_DIR}/dbf)
set(XPL_DEFAULT_WORK_DIR ${XPL_DEFAULT_STATE_DIR}/work)
set(XPL_DEFAULT_CACHE_DIR ${XPL_DEFAULT_STATE_DIR}/cache)
set(XPL_DEFAULT_SCMS_DIR ${XPL_DEFAULT_STATE_DIR}/scms)
set(XPL_DEFAULT_SPOOL_DIR ${XPL_DEFAULT_STATE_DIR}/spool)
set(XPL_DEFAULT_STORE_SYSTEM_DIR ${XPL_DEFAULT_STATE_DIR}/system)
set(XPL_DEFAULT_SYSTEM_DIR ${XPL_DEFAULT_STATE_DIR}/system)
set(XPL_DEFAULT_MAIL_DIR ${XPL_DEFAULT_STATE_DIR}/users)
set(XPL_DEFAULT_COOKIE_DIR ${XPL_DEFAULT_STATE_DIR}/dbf/cookies)
set(XPL_DEFAULT_CERT_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/osslcert.pem)
set(XPL_DEFAULT_RSAPARAMS_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/rsaparams.pem)
set(XPL_DEFAULT_DHPARAMS_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/dhparams.pem)
set(XPL_DEFAULT_RANDSEED_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/randomseed)
set(XPL_DEFAULT_KEY_PATH ${XPL_DEFAULT_STATE_DIR}/dbf/osslpriv.pem)
# FIXME: where did these get defined before?
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set(ZONEINFODIR ${XPL_DEFAULT_DATA_DIR}/zoneinfo)
+11
View File
@@ -0,0 +1,11 @@
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mail and calendering made simple")
set(CPACK_PACKAGE_VENDOR "Bongo Project")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR "${BONGO_V_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${BONGO_V_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${BONGO_V_BUILD}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
include(CPack)
+77
View File
@@ -0,0 +1,77 @@
# - Try to find Log4C
# Once done this will define
#
# LOG4C_FOUND - system has Log4C
# LOG4C_INCLUDE_DIRS - the Log4C include directory
# LOG4C_LIBRARIES - Link these to use Log4C
# LOG4C_DEFINITIONS - Compiler switches required for using Log4C
#
# Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS)
# in cache already
set(LOG4C_FOUND TRUE)
else (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS)
find_path(LOG4C_INCLUDE_DIR
NAMES
log4c.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
mark_as_advanced(LOG4C_INCLUDE_DIR)
find_library(LOG4C_LIBRARY
NAMES
log4c
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
mark_as_advanced(LOG4C_LIBRARY)
if (LOG4C_LIBRARY)
set(LOG4C_FOUND TRUE CACHE INTERNAL "Wether the log4c library has been found" FORCE)
endif (LOG4C_LIBRARY)
set(LOG4C_INCLUDE_DIRS
${LOG4C_INCLUDE_DIR}
)
if (LOG4C_FOUND)
set(LOG4C_LIBRARIES
${LOG4C_LIBRARIES}
${LOG4C_LIBRARY}
)
endif (LOG4C_FOUND)
if (LOG4C_INCLUDE_DIRS AND LOG4C_LIBRARIES)
set(LOG4C_FOUND TRUE)
endif (LOG4C_INCLUDE_DIRS AND LOG4C_LIBRARIES)
if (LOG4C_FOUND)
if (NOT Log4C_FIND_QUIETLY)
message(STATUS "Found Log4C: ${LOG4C_LIBRARIES}")
endif (NOT Log4C_FIND_QUIETLY)
else (LOG4C_FOUND)
if (Log4C_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Log4C")
endif (Log4C_FIND_REQUIRED)
endif (LOG4C_FOUND)
# show the LOG4C_INCLUDE_DIRS and LOG4C_LIBRARIES variables only in the advanced view
mark_as_advanced(LOG4C_INCLUDE_DIRS LOG4C_LIBRARIES)
endif (LOG4C_LIBRARIES AND LOG4C_INCLUDE_DIRS)
+17
View File
@@ -0,0 +1,17 @@
set(PACKAGE CMAKE_PROJECT_NAME)
set(LINUX TRUE)
if(HAVE_TIME_H)
set(HAVE_NANOSLEEP 1)
endif(HAVE_TIME_H)
set(_BONGO_XPL_BIG_ENDIAN FALSE)
set(_BONGO_XPL_LITTLE_ENDIAN TRUE)
set(_BONGO_HAVE_DLFCN_H TRUE)
set(BONGO_BUILD_BRANCH "trunk")
set(BONGO_BUILD_VSTR "r")
set(BONGO_BUILD_VER "10")
+116
View File
@@ -0,0 +1,116 @@
# include here the requirements to build Bongo
# anything which isn't necessary should be marked [optional]
include(CheckIncludeFile)
include(CheckLibraryExists)
include(FindPkgConfig)
# look for header files we need first
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(sys/kstat.h HAVE_KSTAT_H)
check_include_file(sys/vfs.h HAVE_SYS_VFS_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/statvfs.h HAVE_SYS_STATVFS_H)
check_include_file(time.h HAVE_TIME_H)
check_include_file(semaphore.h HAVE_SEMAPHORE_H)
# look for PThreads
include(FindThreads)
if (NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "Bongo requires a platform with PThreads")
endif (NOT CMAKE_USE_PTHREADS_INIT)
# check for LDAP [optional]
check_include_file(ldap.h HAVE_LDAP_H)
if (HAVE_LDAP_H)
check_library_exists(ldap ldap_init "" HAVE_LDAP)
endif (HAVE_LDAP_H)
# check for ODBC [optional]
check_include_file(odbcinst.h HAVE_ODBCINST_H)
if (HAVE_ODBCINST_H)
check_library_exists(odbc SQLConnect "" HAVE_ODBC)
endif (HAVE_ODBCINST_H)
# check for resolv
#check_library_exists(resolv res_init "" HAVE_RESOLV)
#if (NOT HAVE_RESOLV)
# message(FATAL_ERROR "Cannot find resolv library")
#endif (NOT HAVE_RESOLV)
# check for gettext
check_include_file(libintl.h HAVE_LIBINTL_H)
include (FindGettext)
if (NOT GETTEXT_FOUND)
message(FATAL_ERROR "Bongo needs Gettext developer support available")
endif (NOT GETTEXT_FOUND)
check_include_file(kstat.h HAVE_KSTAT_H)
# check for log4c
include(cmake/FindLog4C.cmake)
include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/import/log4c/)
# check for glib
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.10)
include_directories(AFTER ${GLIB2_INCLUDE_DIRS})
# check for GMime
pkg_search_module (GMIME2 REQUIRED gmime-2.6 gmime-2.4 gmime-2.2 gmime-2.0 gmime)
include_directories(AFTER ${GMIME2_INCLUDE_DIRS})
# check for gcrypt
# pkg_check_module
# check for gnutls
pkg_check_modules (GNUTLS REQUIRED gnutls)
# check for sqlite3
pkg_check_modules (SQLITE REQUIRED sqlite3)
# check for curl
pkg_check_modules (CURL REQUIRED libcurl)
# check for libical
check_include_file(libical/ical.h HAVE_ICAL_H)
if (NOT HAVE_ICAL_H)
check_include_file(ical.h HAVE_OLD_ICAL_H)
if (NOT HAVE_OLD_ICAL_H)
message(FATAL_ERROR "Bongo needs libical in order to compile")
endif (NOT HAVE_OLD_ICAL_H)
endif (NOT HAVE_ICAL_H)
check_library_exists(ical icaltime_compare "" HAVE_ICAL)
if (HAVE_ICAL)
set(LIBICAL_LIBRARIES "ical")
else (HAVE_ICAL)
message(FATAL_ERROR "Bongo couldn't find the libical runtime library")
endif (HAVE_ICAL)
# check for Python
include(FindPythonLibs)
if (NOT PYTHONLIBS_FOUND)
message(FATAL_ERROR "Bongo requires Python development libraries installed")
endif (NOT PYTHONLIBS_FOUND)
execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
RESULT_VARIABLE PYTHON_SITEPACKAGES_FOUND
OUTPUT_VARIABLE PYTHON_SITEPACKAGES_PATH_RAW
)
string(STRIP "${PYTHON_SITEPACKAGES_PATH_RAW}" PYTHON_SITEPACKAGES_PATH_RAW)
string(LENGTH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX_LEN)
string(SUBSTRING "${PYTHON_SITEPACKAGES_PATH_RAW}" 0 ${CMAKE_INSTALL_PREFIX_LEN} PYTHON_SITEPACKAGES_PATH_RAW_PREFIX)
if (PYTHON_SITEPACKAGES_FOUND EQUAL 0)
if (PYTHON_SITEPACKAGES_PATH_RAW_PREFIX STREQUAL CMAKE_INSTALL_PREFIX)
set(PYTHON_SITEPACKAGES_PATH "${PYTHON_SITEPACKAGES_PATH_RAW}")
else ()
set(PYTHON_SITEPACKAGES_PATH "${CMAKE_INSTALL_PREFIX}/${PYTHON_SITEPACKAGES_PATH_RAW}")
endif ()
else (PYTHON_SITEPACKAGES_FOUND EQUAL 0)
message(FATAL_ERROR "Couldn't determine where to install Python modules")
endif (PYTHON_SITEPACKAGES_FOUND EQUAL 0)
# check for Doxygen [optional]
include(FindDoxygen)
+83
View File
@@ -0,0 +1,83 @@
/* The username which bongo runs as. */
#cmakedefine BONGO_USER "@BONGO_USER@"
// our package name
#cmakedefine PACKAGE "@CMAKE_PROJECT_NAME@"
// the way we do includes on the python code seems to cause problems
// with the cmake style of defines.
// include defines
#ifndef HAVE_INTTYPES_H
#cmakedefine HAVE_INTTYPES_H
#endif
#ifndef HAVE_SYS_STATVFS_H
#cmakedefine HAVE_SYS_STATVFS_H
#endif
#ifndef HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_STAT_H
#endif
#ifndef HAVE_SYS_VFS_H
#cmakedefine HAVE_SYS_VFS_H
#endif
#ifndef HAVE_KSTAT_H
#cmakedefine HAVE_KSTAT_H
#endif
#ifndef HAVE_SEMAPHORE_H
#cmakedefine HAVE_SEMAPHORE_H
#endif// Directories.txt
#cmakedefine HAVE_ICAL_H 1
#cmakedefine HAVE_OLD_ICAL_H 1
#cmakedefine BINDIR "@BINDIR@"
#cmakedefine SBINDIR "@SBINDIR@"
#cmakedefine LIBDIR "@LIBDIR@"
#cmakedefine LIBEXECDIR "@LIBEXECDIR@"
#cmakedefine DATAROOTDIR "@DATAROOTDIR@"
#cmakedefine DATADIR "@DATADIR@"
#cmakedefine LOCALSTATEDIR "@LOCALSTATEDIR@"
#cmakedefine INCLUDEDIR "@INCLUDEDIR@"
#cmakedefine XPL_DEFAULT_DATA_DIR "@XPL_DEFAULT_DATA_DIR@"
#cmakedefine XPL_DEFAULT_STATE_DIR "@XPL_DEFAULT_STATE_DIR@"
#cmakedefine XPL_DEFAULT_BIN_DIR "@XPL_DEFAULT_BIN_DIR@"
#cmakedefine XPL_DEFAULT_LIB_DIR "@XPL_DEFAULT_LIB_DIR@"
#cmakedefine XPL_DEFAULT_CONF_DIR "@XPL_DEFAULT_CONF_DIR@"
#cmakedefine XPL_DEFAULT_NLS_DIR "@XPL_DEFAULT_NLS_DIR@"
#cmakedefine XPL_DEFAULT_DBF_DIR "@XPL_DEFAULT_DBF_DIR@"
#cmakedefine XPL_DEFAULT_WORK_DIR "@XPL_DEFAULT_WORK_DIR@"
#cmakedefine XPL_DEFAULT_CACHE_DIR "@XPL_DEFAULT_CACHE_DIR@"
#cmakedefine XPL_DEFAULT_SCMS_DIR "@XPL_DEFAULT_SCMS_DIR@"
#cmakedefine XPL_DEFAULT_STORE_SYSTEM_DIR "@XPL_DEFAULT_STORE_SYSTEM_DIR@"
#cmakedefine XPL_DEFAULT_SPOOL_DIR "@XPL_DEFAULT_SPOOL_DIR@"
#cmakedefine XPL_DEFAULT_SYSTEM_DIR "@XPL_DEFAULT_SYSTEM_DIR@"
#cmakedefine XPL_DEFAULT_MAIL_DIR "@XPL_DEFAULT_MAIL_DIR@"
#cmakedefine XPL_DEFAULT_COOKIE_DIR "@XPL_DEFAULT_COOKIE_DIR@"
#cmakedefine XPL_DEFAULT_CERT_PATH "@XPL_DEFAULT_CERT_PATH@"
#cmakedefine XPL_DEFAULT_RSAPARAMS_PATH "@XPL_DEFAULT_RSAPARAMS_PATH@"
#cmakedefine XPL_DEFAULT_DHPARAMS_PATH "@XPL_DEFAULT_DHPARAMS_PATH@"
#cmakedefine XPL_DEFAULT_RANDSEED_PATH "@XPL_DEFAULT_RANDSEED_PATH@"
#cmakedefine XPL_DEFAULT_KEY_PATH "@XPL_DEFAULT_KEY_PATH@"
#cmakedefine LOCALEDIR "@LOCALEDIR@"
#cmakedefine ZONEINFODIR "@ZONEINFODIR@"
#cmakedefine BONGO_BUILD_BRANCH "@BONGO_BUILD_BRANCH@"
#cmakedefine BONGO_BUILD_VSTR "@BONGO_BUILD_VSTR@"
#cmakedefine BONGO_BUILD_VER "@BONGO_BUILD_VER@"
// Legacy defines below
#cmakedefine LINUX
#cmakedefine UNIX
#cmakedefine HAVE_NANOSLEEP
#cmakedefine _BONGO_XPL_BIG_ENDIAN
#cmakedefine _BONGO_XPL_LITTLE_ENDIAN
#cmakedefine _BONGO_HAVE_DLFCN_H
-571
View File
@@ -1,571 +0,0 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2005 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
cc_basename=`echo "$CC" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case "$cc_basename" in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | pw32* | os2*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux*)
case $cc_basename in
icc* | ecc*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
sco3.2v5*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
wl='-Wl,'
;;
sysv4*MP*)
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris* | sysv5*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sunos4*)
hardcode_direct=yes
;;
linux*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = yes; then
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case "$cc_basename" in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | kfreebsd*-gnu | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10* | hpux11*)
if test "$with_gnu_ld" = no; then
case "$host_cpu" in
hppa*64*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=no
;;
ia64*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=no
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
sco3.2v5*)
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4.2uw2*)
hardcode_direct=yes
hardcode_minus_L=no
;;
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
;;
sysv5*)
hardcode_libdir_flag_spec=
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
libname_spec='lib$name'
case "$host_os" in
aix3*)
;;
aix4* | aix5*)
;;
amigaos*)
;;
beos*)
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
shrext=.dll
;;
darwin* | rhapsody*)
shrext=.dylib
;;
dgux*)
;;
freebsd1*)
;;
kfreebsd*-gnu)
;;
freebsd*)
;;
gnu*)
;;
hpux9* | hpux10* | hpux11*)
case "$host_cpu" in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
;;
irix5* | irix6* | nonstopux*)
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux*)
;;
knetbsd*-gnu)
;;
netbsd*)
;;
newsos6)
;;
nto-qnx*)
;;
openbsd*)
;;
os2*)
libname_spec='$name'
shrext=.dll
;;
osf3* | osf4* | osf5*)
;;
sco3.2v5*)
;;
solaris*)
;;
sunos4*)
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
;;
sysv4*MP*)
;;
uts4*)
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF
-773
View File
@@ -1,773 +0,0 @@
dnl -*- mode: m4 -*-
AC_PREREQ(2.52)
AC_INIT(src/libs/msgapi/msgapi.c)
AM_INIT_AUTOMAKE(bongo, 0.1.0)
# this space is here to trick autogen.sh
AM_GNU_GETTEXT([external])
AM_CONDITIONAL(USE_NLS,test "$USE_NLS" = "yes")
AC_CONFIG_HEADERS(config.h)
AX_PREFIX_CONFIG_H([include/bongo-config.h], _BONGO, [config.h])
# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
GETTEXT_PACKAGE=bongo
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
## must come before we use the $USE_MAINTAINER_MODE variable later
AM_MAINTAINER_MODE
AM_PROG_AS
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_ISC_POSIX
AC_HEADER_STDC
AC_C_BIGENDIAN
GCC_STACK_PROTECTOR
# Check taken from glib
AC_MSG_CHECKING(for the suffix of shared libraries)
case "$host_os" in
hpux9* | hpux10* | hpux11*) # taken from ltconfig
glib_gmodule_suffix='sl'
;;
cygwin* | mingw*)
glib_gmodule_suffix='dll'
;;
aix*)
glib_gmodule_suffix='a'
;;
*)
glib_gmodule_suffix='so'
;;
esac
AC_MSG_RESULT(.$glib_gmodule_suffix)
SHARED_POSTFIX=".$glib_gmodule_suffix"
AC_SUBST(SHARED_POSTFIX)
#### gcc warning flags
NO_POINTER_SIGN_WARNINGS=
if test "x$GCC" = "xyes"; then
changequote(,)dnl
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wnested-externs[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wnested-externs" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wpointer-arith[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wpointer-arith" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wcast-align[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wcast-align" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wsign-compare[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wsign-compare" ;;
esac
if test "x$enable_ansi" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -ansi" ;;
esac
case " $CFLAGS " in
*[\ \ ]-D_POSIX_C_SOURCE*) ;;
*) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
esac
case " $CFLAGS " in
*[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
esac
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
if test x$enable_gcov = xyes; then
case " $CFLAGS " in
*[\ \ ]-fprofile-arcs[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -fprofile-arcs" ;;
esac
case " $CFLAGS " in
*[\ \ ]-ftest-coverage[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -ftest-coverage" ;;
esac
## remove optimization
CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
fi
if test -z "$ac_cv_prog_CC"; then
our_gcc="$CC"
else
our_gcc="$ac_cv_prog_CC"
fi
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
*4.) NO_POINTER_SIGN_WARNINGS=-Wno-pointer-sign ;;
*) NO_POINTER_SIGN_WARNINGS="" ;;
esac
changequote([,])dnl
fi
AC_SUBST(NO_POINTER_SIGN_WARNINGS)
AM_PROG_LIBTOOL
#
# Make libtool use --silent when --silent is passed to make
#
changequote(,)dnl
LIBTOOL="${LIBTOOL} \$(shell echo \"\$(MFLAGS)\" | awk '/^[^ ]*s/ { print \"--silent\" }')"
changequote([,])dnl
AC_DEFINE_UNQUOTED(LINUX, "1", [Badly named building-under-autoconf variable])
#####3 Directory management - from dbus' configure.in
AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(DATADIR, "$prefix/share")
AS_AC_EXPAND(BINDIR, $bindir)
AS_AC_EXPAND(SBINDIR, $sbindir)
AS_AC_EXPAND(LIBDIR, $libdir)
AS_AC_EXPAND(PKGLIBEXECDIR, "$libexecdir/$PACKAGE")
### Paths
XPL_DEFAULT_DATA_DIR=${DATADIR}/bongo
AC_SUBST(XPL_DEFAULT_DATA_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_DATA_DIR, "$XPL_DEFAULT_DATA_DIR", [Default data directory])
XPL_DEFAULT_STATE_DIR=${LOCALSTATEDIR}/bongo
AC_SUBST(XPL_DEFAULT_STATE_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_STATE_DIR, "$XPL_DEFAULT_STATE_DIR", [Default state directory])
XPL_DEFAULT_WORK_DIR=${XPL_DEFAULT_STATE_DIR}/work
AC_SUBST(XPL_DEFAULT_WORK_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_WORK_DIR, "$XPL_DEFAULT_WORK_DIR", [Default work directory])
XPL_DEFAULT_DBF_DIR=${XPL_DEFAULT_STATE_DIR}/dbf
AC_SUBST(XPL_DEFAULT_DBF_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_DBF_DIR, "$XPL_DEFAULT_DBF_DIR", [Default dbf directory])
XPL_DEFAULT_CACHE_DIR=${XPL_DEFAULT_STATE_DIR}/cache
AC_SUBST(XPL_DEFAULT_CACHE_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_CACHE_DIR, "$XPL_DEFAULT_CACHE_DIR", [Default cache directory])
XPL_DEFAULT_BIN_DIR=${SBINDIR}
AC_SUBST(XPL_DEFAULT_BIN_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_BIN_DIR, "$XPL_DEFAULT_BIN_DIR", [Default binary directory])
XPL_DEFAULT_LIB_DIR=${LIBDIR}
AC_SUBST(XPL_DEFAULT_LIB_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_LIB_DIR, "$XPL_DEFAULT_LIB_DIR", [Default library directory])
XPL_DEFAULT_CONF_DIR=${SYSCONFDIR}/bongo
AC_SUBST(XPL_DEFAULT_CONF_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_CONF_DIR, "$XPL_DEFAULT_CONF_DIR", [Default config directory])
XPL_DEFAULT_NLS_DIR=${DATADIR}/bongo/nls
AC_SUBST(XPL_DEFAULT_NLS_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_NLS_DIR, "$XPL_DEFAULT_NLS_DIR", [Default nls directory])
XPL_DEFAULT_SCMS_DIR=${XPL_DEFAULT_STATE_DIR}/scms
AC_SUBST(XPL_DEFAULT_SCMS_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_SCMS_DIR, "$XPL_DEFAULT_SCMS_DIR", [Default scms directory])
XPL_DEFAULT_SPOOL_DIR=${XPL_DEFAULT_STATE_DIR}/spool
AC_SUBST(XPL_DEFAULT_SPOOL_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_SPOOL_DIR, "$XPL_DEFAULT_SPOOL_DIR", [Default spool directory])
XPL_DEFAULT_STORE_SYSTEM_DIR=${XPL_DEFAULT_STATE_DIR}/system
AC_SUBST(XPL_DEFAULT_STORE_SYSTEM_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_STORE_SYSTEM_DIR, "$XPL_DEFAULT_STORE_SYSTEM_DIR", [Default store system directory])
XPL_DEFAULT_MAIL_DIR=${XPL_DEFAULT_STATE_DIR}/users
AC_SUBST(XPL_DEFAULT_MAIL_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_MAIL_DIR, "$XPL_DEFAULT_MAIL_DIR", [Default mail directory])
XPL_DEFAULT_COOKIE_DIR=${XPL_DEFAULT_STATE_DIR}/dbf/cookies
AC_SUBST(XPL_DEFAULT_COOKIE_DIR)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_COOKIE_DIR, "$XPL_DEFAULT_COOKIE_DIR", [Default cookie directory])
XPL_DEFAULT_CERT_PATH=${XPL_DEFAULT_STATE_DIR}/dbf/osslcert.pem
AC_SUBST(XPL_DEFAULT_CERT_PATH)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_CERT_PATH, "$XPL_DEFAULT_CERT_PATH", [Default cert path])
XPL_DEFAULT_RSAPARAMS_PATH=${XPL_DEFAULT_STATE_DIR}/dbf/rsaparams.pem
AC_SUBST(XPL_DEFAULT_RSAPARAMS_PATH)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_RSAPARAMS_PATH, "$XPL_DEFAULT_RSAPARAMS_PATH", [Default path for RSA parameters])
XPL_DEFAULT_DHPARAMS_PATH=${XPL_DEFAULT_STATE_DIR}/dbf/dhparams.pem
AC_SUBST(XPL_DEFAULT_DHPARAMS_PATH)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_DHPARAMS_PATH, "$XPL_DEFAULT_DHPARAMS_PATH", [Default path for DH parameters])
XPL_DEFAULT_RANDSEED_PATH=${XPL_DEFAULT_STATE_DIR}/dbf/randomseed
AC_SUBST(XPL_DEFAULT_RANDSEED_PATH)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_RANDSEED_PATH, "$XPL_DEFAULT_RANDSEED_PATH", [Default path for seed to RNG])
XPL_DEFAULT_KEY_PATH=${XPL_DEFAULT_STATE_DIR}/dbf/osslpriv.pem
AC_SUBST(XPL_DEFAULT_KEY_PATH)
AC_DEFINE_UNQUOTED(XPL_DEFAULT_KEY_PATH, "$XPL_DEFAULT_KEY_PATH", [Default key path])
SAVE_LIBS=$LIBS
LIBS=
AC_CHECK_LIB(resolv, res_init,
[],
[
AC_CHECK_LIB(resolv, __res_init)
]
)
RESOLV_LIBS=$LIBS
LIBS=$SAVE_LIBS
AC_SUBST(RESOLV_LIBS)
have_ldap="no"
info_ldap="No. LDAP auth backend will be unavailable."
AC_CHECK_HEADER(ldap.h,[
AC_CHECK_LIB(ldap, ldap_init,[
LDAP_LIBS="-lldap"
have_ldap="yes"
info_ldap="Yes. LDAP auth backend will be available."
])
])
AM_CONDITIONAL(HAVE_LDAP,test "$have_ldap" = "yes")
AC_SUBST(LDAP_LIBS)
have_odbc="no"
info_odbc="No. ODBC auth backend will be unavailable."
AC_CHECK_HEADER(odbcinst.h,[
AC_CHECK_LIB(odbc, SQLConnect,[
ODBC_LIBS="-lodbc"
have_odbc="yes"
info_odbc="Yes. ODBC auth backend will be available."
])
])
AM_CONDITIONAL(HAVE_ODBC,test "$have_odbc" = "yes")
AC_SUBST(ODBC_LIBS)
have_kstat="no"
AC_CHECK_LIB(kstat, kstat_open,[
AC_CHECK_HEADERS(kstat.h, [have_kstat="yes"])
])
if test "$have_kstat" = "yes"; then
KSTAT_LIBS="-lkstat"
fi
AC_SUBST(KSTAT_LIBS)
AM_PROG_LEX
if test "$LEX" = "lex" -a -z "`which $LEX 2>/dev/null`"; then
AC_MSG_ERROR([Could not locate a suitable lexical generator. Install flex.])
fi
AC_PROG_YACC
if test "$YACC" = "yacc" -a -z "`which $YACC 2>/dev/null`"; then
AC_MSG_ERROR([Could not locate a suitable parser generator. Install bison.])
fi
AC_CHECK_FUNCS(strcasecmp strncasecmp stricmp strnicmp gettimeofday vsnprintf _vsnprintf consoleprintf ungetcharacter RingTheBell dlopen dlsym _commit fsync FEFlushWrite dos2calendar _ConvertDOSTimeToCalendar delay statfs statvfs getpwnam_r snprintf _snprintf gmtime_r localtime_r usleep nanosleep)
AC_CHECK_HEADERS(syslog.h sys/param.h sys/sys/mount.h semaphore.h sys/socket.h netinet/in.h resolv.h sys/sysinfo.h)
AC_CHECK_HEADERS(sys/mount.h sys/statvfs.h sys/vfs.h alloca.h)
AC_CHECK_DECLS([ns_c_in],,,[#include <arpa/nameser.h>])
ALL_CFLAGS='-I$(top_builddir) -I$(top_builddir)/include -I$(top_srcdir)/import/log4c'
ALL_LIBS=
AC_SUBST(ALL_CFLAGS)
AC_SUBST(ALL_LIBS)
DL_LIBS=
AC_CHECK_LIB(c, dlopen, DL_LIBS="", [AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl")])
AC_SUBST(DL_LIBS)
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([Bongo requires pkg-config to be installed])
fi
have_check=no
info_check="No. Unit tests will not be run."
AM_PATH_CHECK(0.9.0,
[
have_check=yes
info_check="Yes."
AC_DEFINE(BONGO_HAVE_CHECK, [], [Controls how tests that depend on check compile.])
],
[
AC_MSG_WARN([The check C unit testing framework is not installed,])
AC_MSG_WARN([or is not sufficiently up to date.])
AC_MSG_WARN([Tests relying on it in the make check target will not run.])
]
)
AM_CONDITIONAL(HAVE_CHECK, test x$have_check = xyes)
dnl The "manual" configuration is because a couple of old distros don't have
dnl the GNUTLS m4 thing. Centos 4, RHEL 4, Mandriva 2006(?)
PKG_CHECK_MODULES(GNUTLS, gnutls,
echo Using pkg-config GNUTLS configuration,
echo Trying to configure GNUTLS manually
GNUTLS_LIBS="-lgnutls"
GNUTLS_CFLAGS=""
)
AM_PATH_LIBGCRYPT()
AC_CHECK_GMIME()
AM_PATH_PYTHON(2.3)
PYTHON_INST_PREFIX=`$PYTHON -c 'import sys; print sys.prefix'`
PYTHON_CPPFLAGS="-I$PYTHON_INST_PREFIX/include/python$PYTHON_VERSION"
case "$host" in
*darwin*)
PYTHON_LIBS="-framework Python"
;;
*freebsd*)
PYTHON_LIBS="-L$PYTHON_INST_PREFIX/lib -lpython$PYTHON_VERSION"
;;
*)
# this is the correct way to find the python libdir, but
# people should just set LDFLAGS or whatever instead:
# PYTHON_LIBS=`$PYTHON -c 'import sys
#try:
# print sys.lib
#except:
# print "lib"
#'`
# PYTHON_LIBS="-L$PYTHON_INST_PREFIX/$PYTHON_LIBS -lpython$PYTHON_VERSION"
PYTHON_LIBS="-lpython$PYTHON_VERSION"
;;
esac
dnl Check for ElementTree lxml
prog="
import lxml.etree as et
"
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
AC_MSG_RESULT([Found ElementTree lxml])
info_lxml="Yes."
else
AC_MSG_RESULT([Couldn't find ElementTree lxml module for python])
info_lxml="No. CalDAV runtime requires this library"
fi
LIBS_save="$LIBS"
CPPFLAGS_save="$CPPFLAGS"
LIBS="$LIBS $PYTHON_LIBS"
CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
have_python="no"
AC_CHECK_FUNC(PyArg_Parse, [
AC_CHECK_HEADERS(Python.h, [have_python="yes"])
])
if test x$have_python != xyes ; then
AC_MSG_ERROR([Dragonfly requires python-devel, or python built with shared library support (--enable-shared)])
fi
LIBS="$LIBS_save"
CPPFLAGS="$CPPFLAGS_save"
AC_SUBST(CFLAGS_save)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_CPPFLAGS)
AS_AC_EXPAND(PYTHONDIR, $pythondir)
AS_AC_EXPAND(PYEXECDIR, $pyexecdir)
# Check for openldap's slapd
AC_ARG_WITH([slapd],
AC_HELP_STRING([--with-slapd=FILE],
[Path to slapd binary]),
[DEFAULT_SLAPD_PATH="$with_slapd"],
[AC_PATH_PROG(DEFAULT_SLAPD_PATH,[slapd],[/usr/libexec/slapd],[$PATH:/sbin:/usr/sbin:/usr/libexec:/usr/lib/openldap:/opt/sfw/libexec:/opt/csw/libexec:/usr/local/libexec])])
DEFAULT_SLAPD_SCHEMA_DIR="/etc/openldap/schema"
# Check for openldap's schema files
AC_ARG_WITH([slapd-schema],
AC_HELP_STRING([--with-slapd-schema=DIR],
[Path to slapd schema directory]),
[DEFAULT_SLAPD_SCHEMA_DIR=$withval],
[
for conf in /etc /opt/sfw/etc /opt/csw/etc /usr/local/etc; do
for ldap in openldap ldap; do
if test -e "${conf}/${ldap}/schema/core.schema"; then
DEFAULT_SLAPD_SCHEMA_DIR="${conf}/${ldap}/schema"
break 2
fi
done
done
])
AC_SUBST(DEFAULT_SLAPD_SCHEMA_DIR)
# Check for apache's apxs
AC_PATH_PROG(APXS,[apxs],no,[$PATH:/sbin:/usr/sbin:/usr/local/apache2/bin:/usr/apache2/bin:/usr/lib/apache2/bin:/usr/local/apache/bin:/usr/lib/apache/bin:/usr/pkg/sbin:/opt/csw/apache/bin])
APACHE_MOD_DIR="/usr/local/apache2/libexec"
# Look for apache's module dir
AC_ARG_WITH([apache-modules],
AC_HELP_STRING([--with-apache-modules=DIR],
[Path to apache module directory]),
[APACHE_MOD_DIR=$withval],
[
if test "x$APXS" != "xno"; then
APACHE_MOD_DIR="`${APXS} -q LIBEXECDIR`"
else
for apache in apache2 apache; do
for lib in lib64 lib; do
APACHE_MOD_DIR="/usr/${lib}/${apache}"
if test -d ${APACHE_MOD_DIR}; then
break 2
fi
done
done
fi
])
AC_SUBST(APACHE_MOD_DIR)
AC_MSG_CHECKING([for Apache module directory])
AC_MSG_RESULT([$APACHE_MOD_DIR])
htl10n_jsfiles=
for lang in en `cd po && cd bongo-web && ls *.po | sed s/.po$//`; do
htl10n_jsfiles="$htl10n_jsfiles src/www/l10n/$lang.js"
done
AC_SUBST(htl10n_jsfiles)
POFILES=
for file in `find po -name *.po`; do
POFILES="$POFILES $file"
done
AC_SUBST(POFILES)
PTHREAD_CFLAGS=
PTHREAD_LIBS=
# Check taken from glib
AC_MSG_NOTICE(for pthread flags)
PTHREAD_LIBS="-pthread -lpthread"
case "$host" in
*-freebsd*)
AC_MSG_CHECKING(FreeBSD Release Date)
if test -x /sbin/sysctl; then
os_version=`/sbin/sysctl -n kern.osreldate`
else
os_version=000000
fi
AC_MSG_RESULT($os_version)
# 502102 is when libc_r switched to libpthread (aka libkse).
if test $os_version -ge "502102"; then
PTHREAD_CFLAGS="-pthread"
PTHREAD_LIBS="-pthread -lpthread"
else
PTHREAD_CFLAGS="-pthread -D_THREAD_SAFE -D_REENTRANT"
PTHREAD_LIBS="-pthread -lc_r"
fi
;;
*darwin*)
#As of 10.4.2, POSIX Unnamed Semaphores are not implemented, use Carbon Semaphores instead
PTHREAD_LIBS="-lpthread -Wl,-framework -Wl,Carbon"
PTHREAD_CFLAGS="-I/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers"
CFLAGS="$CFLAGS -DMACOSX -I/opt/local/include"
;;
*solaris*)
if test "x$GCC" = "xyes"; then
PTHREAD_CFLAGS="-pthreads"
else
PTHREAD_CFLAGS="-mt"
fi
PTHREAD_LIBS="-pthread -lpthread"
;;
esac
AC_MSG_CHECKING(pthread cflags)
AC_MSG_RESULT($PTHREAD_CFLAGS)
AC_MSG_CHECKING(pthread libs)
AC_MSG_RESULT($PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
case xyes in
x$ac_cv_c_bigendian)
XPL_BIG_ENDIAN=1
XPL_LITTLE_ENDIAN=0
;;
*)
XPL_BIG_ENDIAN=0
XPL_LITTLE_ENDIAN=1
;;
esac
AC_DEFINE_UNQUOTED(XPL_BIG_ENDIAN, $XPL_BIG_ENDIAN, [Whether the system is big endian])
AC_DEFINE_UNQUOTED(XPL_LITTLE_ENDIAN, $XPL_LITTLE_ENDIAN, [Whether the system is little endian])
AC_ARG_WITH([user],
AC_HELP_STRING([--with-user=USERNAME],
[run bongo as unprivileged user USERNAME]))
BONGO_USER="$with_user"
AC_DEFINE_UNQUOTED(BONGO_USER,"$BONGO_USER", [The username which bongo runs as.])
AC_SUBST(BONGO_USER)
info_bongo_user=$BONGO_USER
if test "x$BONGO_USER" = "x"; then
info_bongo_user="(unspecified)"
fi
AC_ARG_ENABLE([conntrace],
AC_HELP_STRING([--enable-conntrace],
[enable verbose connection tracing]),
[if test "x$enableval" != "x"; then
AC_DEFINE_UNQUOTED([CONN_TRACE], [1], [enable verbose connection tracing])
fi])
AC_ARG_ENABLE([memmgrleakreporting],
AC_HELP_STRING([--enable-memmgrleakreporting],
[enable leak tracking and reporting in memmgr]),
[if test "x$enableval" != "x"; then
AC_DEFINE_UNQUOTED([MEMMGR_DEBUG], [1], [enable leak tracking and reporting in memmgr])
fi])
AC_ARG_ENABLE([mdbdebug],
AC_HELP_STRING([--enable-mdbdebug],
[enable highly insecure protocol commands that can be used to scale test mdb]),
[if test "x$enableval" != "x"; then
AC_DEFINE_UNQUOTED([MDB_DEBUG], [1], [enable highly insecure protocol commands that can be used to scale test mdb])
fi])
AC_ARG_ENABLE([system-malloc],
AC_HELP_STRING ([--enable-system-malloc],
[do not use memmgr pools]),
[if test "x$enableval" != "x"; then
AC_DEFINE_UNQUOTED([SYSTEM_MALLOC], [1], [do not use memmgr pools])
fi])
info_debug_cflags="no"
AC_ARG_ENABLE([debug-cflags],
AC_HELP_STRING([--enable-debug-cflags],
[enable compile flags that make things work better in gdb]),
[if test "x$enableval" != "x"; then
# this may need to switch on the operating system to set the
# appropriate flags on non-Linux systems
CFLAGS="$CFLAGS -g -g3 -O0 -gdwarf-2" ; export CFLAGS
CXXFLAGS="$CXXFLAGS -g -g3 -O0 -gdwarf-2" ; export CXXFLAGS
info_debug_cflags="yes"
fi])
AC_CHECK_SIZEOF(char*)
AC_CHECK_SIZEOF(void*)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_DEFINE_UNQUOTED(SQLITE_PTR_SZ, $ac_cv_sizeof_charp, [Size of a char *])
case $ac_cv_sizeof_voidp in
$ac_cv_sizeof_long) pi_cast='(long)' pui_cast='(unsigned long)' ;;
*) pi_cast='' pui_cast='' ;;
esac
AC_MSG_RESULT($pi_cast $pui_cast)
AC_DEFINE_UNQUOTED(XPL_POINTER_TO_INT_CAST, $pi_cast, [How to cast a pointer to an int])
AC_DEFINE_UNQUOTED(XPL_POINTER_TO_UINT_CAST, $pui_cast, [How to cast an unsigned pointer to an int])
LIBCURL_CHECK_CONFIG()
if test "x$LIBCURL" = "x"; then
AC_MSG_ERROR(Cannot find cURL. Please install the cURL development library.)
else
AC_MSG_RESULT(Using system cURL)
info_curl="system"
AC_SUBST(LIBCURL_CFLAGS, $LIBCURL_CPPFLAGS)
AC_SUBST(LIBCURL_LIBS, $LIBCURL)
fi
# import libraries
AC_CHECK_SQLITE3()
case "x$SQLITE_LIBS" in
x)
info_sqlite="import"
;;
*import*)
info_sqlite="import"
;;
*)
info_sqlite="system"
;;
esac
if test "x$info_sqlite" = "ximport"; then
AC_MSG_RESULT(Using imported SQLite)
AC_CONFIG_SUBDIRS([import/sqlite3])
AC_SUBST(SQLITE_CFLAGS, "-I\$(top_srcdir)/import/sqlite3")
AC_SUBST(SQLITE_LIBS, "\$(top_srcdir)/import/sqlite3/libbongosqlite3.la")
else
AC_MSG_RESULT(Using system SQLite)
fi
have_libical="no"
info_libical="import"
AC_CHECK_HEADER(ical.h,[
AC_CHECK_LIB(ical, icalparser_parse_string, [
have_libical="yes"
info_libical="system"
])
])
AM_CONDITIONAL(HAVE_LIBICAL,test "$have_odbc" = "yes")
AC_SUBST(LIBICAL_LIBS)
if test "x$info_libical" = "ximport"; then
AC_MSG_RESULT(Using imported libical)
AC_CONFIG_SUBDIRS([import/libical])
AC_SUBST(LIBICAL_CFLAGS, "-I\$(top_srcdir)/import/libical/src -I\$(top_srcdir)/import/libical/src/libical")
AC_SUBST(LIBICAL_LIBS, "\$(top_srcdir)/import/libical/src/libical/libical-bongo.la")
else
AC_MSG_RESULT(Using system libical)
AC_SUBST(LIBICAL_LIBS, "-lical")
AC_SUBST(LIBICAL_CFLAGS, "")
fi
AC_SUBST(IMPORT_SUBDIRS, $subdirs)
# check for doxygen
AC_PATH_PROG(DOXYGEN, doxygen, NO_DOXYGEN)
if test "$DOXYGEN" = NO_DOXYGEN; then
AC_MSG_NOTICE([Couldn't find Doxygen - documentation cannot be built])
fi
ac_configure_args="$ac_configure_args --enable-threadsafe --enable-cross-thread-connections --disable-tcl"
# disabled agents
# src/agents/mailprox/Makefile
# src/agents/rules/Makefile
# src/agents/pluspack/Makefile
# src/agents/calcmd/Makefile
AC_OUTPUT([
Makefile
bongo.pc
import/log4c/Makefile
import/log4c/sd/Makefile
import/log4c/log4c/Makefile
include/Makefile
init/bongo.init.fc4
init/bongo.init.sles9
init/bongo.init.suse10
init/bongo.init.rpl
init/bongoinit.conf.rpl
init/http-bongo.solaris-smf
init/svc-bongo.solaris-smf
src/agents/alarm/Makefile
src/agents/antispam/Makefile
src/agents/avirus/Makefile
src/agents/collector/Makefile
src/agents/generic/Makefile
src/agents/imap/Makefile
src/agents/imap/tests/Makefile
src/agents/itip/Makefile
src/agents/pop/Makefile
src/agents/queue/Makefile
src/agents/smtp/Makefile
src/agents/store/Makefile
src/agents/store/tests/Makefile
src/apps/manager/Makefile
src/apps/config/Makefile
src/apps/sendmail/Makefile
src/apps/backup/Makefile
src/apps/queuetool/Makefile
src/apps/storetool/Makefile
src/apps/storetool/demo/Makefile
src/apps/testtool/Makefile
src/libs/cal/Makefile
src/libs/cal/tests/Makefile
src/libs/calcmd/Makefile
src/libs/calcmd/tests/Makefile
src/libs/connio/Makefile
src/libs/connio/tests/Makefile
src/libs/json/Makefile
src/libs/streamio/Makefile
src/libs/streamio/codec/Makefile
src/libs/logger/Makefile
src/libs/memmgr/Makefile
src/libs/msgapi/Makefile
src/libs/nmap/Makefile
src/libs/python/Makefile
src/libs/python/bongo-python-wrapper
src/libs/python/libbongo/Makefile
src/libs/python/bongo/Xpl.py
src/libs/bongoutil/Makefile
src/libs/bongoutil/tests/Makefile
src/libs/xpl/Makefile
src/libs/xpl/tests/Makefile
src/www/Makefile
src/www/bongo.conf
zoneinfo/Makefile
man/Makefile
po/Makefile
])
info_bongo_version=`$AWK '{ if ($ 1 == "#define" && $ 2 == "BONGO_BUILD_VER") print $ 3; }' < "$(top_srcdir)/include/bongo-buildinfo.h" | tr -d '"'`
AC_MSG_NOTICE([Configured to build Bongo:
Bongo version: ${info_bongo_version}
Install prefix: ${prefix}
Compiler: ${CC}
Bongo user: ${info_bongo_user}
Debug CFLAGS: ${info_debug_cflags}
Required libraries:
CLucene: ${info_clucene}
CURL: ${info_curl}
SQLite: ${info_sqlite}
libical: ${info_libical}
Optional libraries:
LDAP: ${info_ldap}
ODBC: ${info_odbc}
Check: ${info_check}
lxml: ${info_lxml}
])
-201
View File
@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-22
View File
@@ -1,22 +0,0 @@
As with most development projects, contributions come from many people and in
many forms. The CLucene project would like to thank it's many contributors.
Omissions are merely accidental, please e-mail ustramooner@users.sourceforge.net
if you have been left out or a contribution is not mentioned.
CLucene was originally ported to C++ by Ben van Klinken (ustramooner@users.sourceforge.net)
from Doug Cutting's popular java search engine, Lucene (see http://lucene.apache.org).
Here is a list of contributors. Please send me an email at ustramooner@users.sourceforge.net
if I have left you out.
Doug Cutting cutting@users.sourceforge.net
John Wheeler j_wheeler@users.sourceforge.net
Robert G. Ristroph rgristroph@users.sourceforge.net
David Rushby woodsplitter@users.sourceforge.net
Jimmy Pritts jpritts@sdf.lonestar.org
Peter Edwards peter@dragonstaff.co.uk
Jorge Sabater Redondo jsabater@elderecho.com
Daniel Glassey danglassey@ntlworld.com
Peter Gladkikh batyi@mail.ru
Pedja amigo@max3d.com
Peter Hodges hodges.peter@gmail.com
-69
View File
@@ -1,69 +0,0 @@
License
The CLucene Core Library uses a dual license strategy for the source code.
These licenses are the GNU Lesser General Public License (LGPL) and the Apache
License (Version 2.0). Users can choose the license they wish to distribute
their software under. This means that you do not need to abide by *both*
licenses, but rather than you can choose the license which most suits your
needs.
To rephrase this and to make it perfectly clear:
CLucene is distributed under the GNU Lesser General Public License (LGPL)
*or*
the Apache License, Version 2.0
However, we are an open source project, and we encourage users to use the LGPL
license and participate fully in the free software community. Dual licensing
of the CLucene source code provides open and free access to the technology both
for the GPL community and for other developers or companies that cannot use the
GPL.
You can freely modify, extend, and improve the CLucene source code. The only
question is whether or not you must provide the source code and contribute
modifications to the community. The GNU and Apache licenses allow different
ranges of flexibility in this regard, but in the end, regardless of the license
used, we highly recommend that you submit any bugs, incompatibilities or
added features.
Note that this same license does *not* apply to the CLucene Contributions
package. You should read the COPYING file in that directory or package for
more information.
CLUCENE SUBCOMPONENTS:
CLucene includes a number of subcomponents with separate copyright
notices and license terms. Your use of the source code for the
these subcomponents is subject to the terms and conditions of the
following licenses.
For the src\CLucene\util\MD5Digester.cpp component:
/*
* This is work is derived from material Copyright RSA Data Security, Inc.
*
* The RSA copyright statement and Licence for that original material is
* included below. This is followed by the Apache copyright statement and
* licence for the modifications made to that material.
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
View File
-977
View File
@@ -1,977 +0,0 @@
# Doxyfile 1.2.18
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = @PACKAGE@
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = @VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = ./doc
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
# (Japanese with english messages), Korean, Norwegian, Polish, Portuguese,
# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian.
OUTPUT_LANGUAGE = English
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these class will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
# members of a class in the documentation of that class as if those members were
# ordinary class members. Constructors, destructors and assignment operators of
# the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH =
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower case letters. If set to YES upper case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
CASE_SENSE_NAMES = YES
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# reimplements.
INHERIT_DOCS = YES
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
# disable (NO) the deprecated list. This list is created by putting \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consist of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C.
# For instance some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
# only. Doxygen will then generate output that is more tailored for Java.
# For instance namespaces will be presented as packages, qualified scopes
# will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ./src/CLucene
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
# *.h++ *.idl *.odl
FILE_PATTERNS = *.h
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = CLBackwards.h mem.h
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
EXCLUDE_PATTERNS = "**/config/**"
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
INPUT_FILTER =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES (the default)
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER = ./doc/helpheader.htm
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = ./doc/helpfooter.htm
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output dir.
CHM_FILE =
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
# be used to specify the location (absolute path including file name) of
# the HTML help compiler (hhc.exe). If non empty doxygen will try to run
# the html help compiler on the generated index.hhp.
HHC_LOCATION =
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the Html help documentation and to the tree view.
TOC_EXPAND = NO
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
# generated containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
# or Internet explorer 4.0+). Note that for large projects the tree generation
# can take a very long time. In such cases it is better to disable this feature.
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimised for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assigments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_XML = NO
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH = ./src/
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED = "_MSC_VER=1400"
PREDEFINED += "WIN32"
PREDEFINED += "LUCENE_HIDE_INTERNAL"
#namespaces
PREDEFINED += "CL_NS(sub)=lucene::sub"
PREDEFINED += "CL_NS2(sub,sub2)=lucene::sub:sub2"
PREDEFINED += "CL_NS_DEF(sub)=namespace lucene{ namespace sub{"
PREDEFINED += "CL_NS_DEF2(sub,sub2)=namespace lucene{ namespace sub{ namespace sub2 {"
PREDEFINED += "CL_NS_END=}}"
PREDEFINED += "CL_NS_END2=}}}"
PREDEFINED += "CL_NS_USE(sub)=using namespace lucene::sub"
PREDEFINED += "CL_NS_USE2(sub,sub2)=using namespace lucene::sub::sub2"
PREDEFINED += "CL_NS_STD(func)=std::func"
PREDEFINED += "CL_NS_HASHING(func)=std::func"
PREDEFINED += "LUCENE_BASE=public CL_NS(debug)::LuceneBase"
PREDEFINED += "LUCENE_POOLEDBASE(sc)=LUCENE_BASE"
PREDEFINED += "LUCENE_REFBASE=public CL_NS(debug)::LuceneBase"
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse the
# parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tagfiles.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
# super classes. Setting the tag to NO turns the diagrams off. Note that this
# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
# recommended to install and use dot, since it yield more powerful graphs.
CLASS_DIAGRAMS = YES
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = @enable_dot@
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermedate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
# The SEARCHENGINE tag specifies whether or not a search engine should be
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
-92
View File
@@ -1,92 +0,0 @@
CVS
---
CLucene's source repository is in SVN
For information on CVS, see:
http://sourceforge.net/svn/?group_id=80013
Coding Style
------------
CLucene follows a hybrid coding style. Because of the nature of the code being
a java port, there are naturally some java like syntax.
todo: put the coding standard here
* Never use CL_NS_USE(x) in a header file (use CL_NS(x):: for each class), it defeats the purpose of namespaces.
* Use CL_NS_USE(x) in .cpp files if there are more than a few usages of that namespace.
Good development tips
---------------------
When developing, use the available clucene debugging tools:
* _CND_DEBUG - condition debugging, an 'assert' type system (or configure with --enable-cnddebug)
* LUCENE_ENABLE_MEMLEAKTRACKING - to assist in memory leak tracking (or configure with --enable-debug),
enable this. This keeps track of clucene object creations
and deletions. Always use _CLNEW and _CLDELETE. At the end
of your program, call:
_lucene_run_objectcheck
lucene::debug::LuceneBase::__cl_PrintUnclosedObjects();
which prints all the open clucene objects. Then call
lucene::debug::LuceneBase::__cl_ClearMemory();
which clears all the clucene memory, so that you can
use other memory tracking tools to further help you
discover memory leaks
__cl_PrintUnclosedObjects returns a list of objects with
the number that it was created at. If your debugger allows
you to set watches you can add:
_lucene_counter_break
to the watch list and change the value to this number. Then
it will break into CLDebugBreak in the StdHeader.cpp file.
Another trick is to use set:
_lucene_run_objectcheck
to true. This will check the validity of memory before deleting it.
It can't always help, but may help in some situations.
Good performance tips:
CLucene has a lot of new changes to help improve performance.
Some of them are still being tuned...
LUCENE_ENABLE_MEMORY_POOL helps speed up allocations for small
objects. The types of classes who are pooled are done on a
class by class basis - thus it is still being tuned. More testing
is required to see which classes would benefit from pooling.
(currently this is broken, i think)
MSVC profiling tutorial:
http://webserver.tc.cornell.edu/services/edu/topics/Performance/Profiling/more.asp
For GCC see gprof
you can enable gprof by configuring with --enable-gprof
Developing
----------
When developing, please keep in mind cross-platform issues and also
character set issues (unicode/ascii).
Hint:
To do a quick test to see if the code compiles
run this command from the root directory of clucene.
It will compile all the CLucene code monolithically.
% cd src; make monolithic; cd ../test; make monolithic; ./cl_test_monolithic
This will do a quick compile then run all the clucene tests.
GDB - GNU debugging tool
------------------------
This is not clucene specific, but useful for novices none the less.
Because cl_test is a libtool bash script, you can use this command to
run gdb:
libtool --mode=execute gdb cl_test
Then type run to start the debug tool.
If a crash occurs, you can type bt to get a backtrace.
-69
View File
@@ -1,69 +0,0 @@
Linux Build instructions
=======================================
If you downloaded CLucene as a tar ball you should be able to skip straight
to the section titled 'building', otherwise read the next section
Rebuilding the autobuild scripts
--------------------------------
If you made changes to the configure.ac or any of the Makefile.am
files you will also need to run through this process.
Requirements:
GNU autotools is required. I have the following versions installed:
Autoconf 2.57
Automake 1.72
Libtool 1.5a
If you use significantly older versions, I can almost guarantee
issues. This is because each of the autotools is constantly changing
with little regard to backward compatability or even compatiability
with the other autotools.
Run the autogen.sh file in the root directory of clucene to run the necessary commands.
Building
--------
The following will get you building assuming that you have suffciently
recent buld tools installed.
1.) unpack tarball
2.) cd into clucene
3.) if you downloaded a tar version skip to 5
4.) run ./autogen.sh
5.) run ./configure
6.) run make
7.) things will churn for a very long time, the clucene library will
be built as well as the examples.
8.) check the src/demo, test and src directory
In src/demo you should see:
cl_demo
In test you should see
cl_test
In src you should see:
libclucene.so.0.0.0 libclucene.la libclucene.a
and symbolic links to these files.
9.) If you want to run make install to copy the clucene files into the system
include and lib directories
10.) You may have to run
export LD_LIBRARY_PATH=/path/to/clucene/lib
11.) run ./cl_test in the test directory and check that the tests all run
Alternative (faster) way of building:
-------------------------------------
This method does not create library files, so depending on your needs you may not
find this method useful.
* Do steps 1-5 of the previous build process.
* Change directory into src/
* run make monolithic
* Change directory into test/ (cd ../test/)
* run make monolithic
* You should see cl_test_monolithic in this directory
* run ./cl_test_monolithic and check that the tests all run
-9
View File
@@ -1,9 +0,0 @@
project clucene
: source-location src/ ;
lib libclucene : CLucene/CLMonolithic.cpp
: <include>src/ ;
-14
View File
@@ -1,14 +0,0 @@
project clucene
: requirements <include>$(BOOST_ROOT)
: requirements <include>src/
: usage-requirements <include>$(BOOST_ROOT)
: usage-requirements <include>src/
: build-dir build
;
#todo: fix this
build-project build/boost ;
build-project test ;
build-project contributions/demo ;
build-project contributions/logreader ;
-92
View File
@@ -1,92 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)
SUBDIRS = src test
DIST_SUBDIRS = src test doc win32 .
ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
EXTRA_DIST = $(top_srcdir)/APACHE.license \
$(top_srcdir)/project-root.jam \
$(top_srcdir)/Jamfile.v2 \
$(top_srcdir)/Jamfile \
$(top_srcdir)/autogen.sh \
$(top_srcdir)/HACKING \
$(top_srcdir)/REQUESTS
distall: distdir
$(AMTAR) chof - $(distdir) >$(distdir).tar
GZIP=$(GZIP_ENV) gzip -c $(distdir).tar >$(distdir).tar.gz
bzip2 -9 -c $(distdir).tar >$(distdir).tar.bz2
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
-rm -f $(distdir).tar
$(am__remove_distdir)
dist-hook:
rm -rfd `find $(distdir)/ -name CVS`
rm -rfd `find $(distdir)/ -name .svn`
rm -rfd `find $(distdir)/ -name .dep`
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 \
configure \
config.h.tmp.in
DISTCLEANFILES = *.tar.gz \
*.tar.bz2 \
*.zip \
_configs.sed \
src/CLucene/clucene-config.h \
config.h.tmp
upload:
make distcheck
ncftpput -v upload.sourceforge.net /incoming @PACKAGE@-@VERSION@.tar.gz
doxygen:
rm -fdr ./doc/html
doxygen Doxyfile
cp ./doc/clucene.jpg ./doc/html/clucene.jpg
#test-compiles using different compile options
test-all: test-pedantic test-ascii test-namespace test-mmap test-mpool test-mtracking test-refcnt test-minqp
test-do:
@rm -f src/CLMonolithic.$(OBJEXT)
@rm -f test/cl_test_monolithic$(EXEEXT)
@rm -f test/CLMonolithic_Test.$(OBJEXT)
cd src && $(MAKE) $(AM_MAKEFLAGS) CLMonolithic.$(OBJEXT) AM_CPPFLAGS="-pedantic $(AM_CPPFLAGS)"
cd test && $(MAKE) $(AM_MAKEFLAGS) CLMonolithic_Test.$(OBJEXT) AM_CPPFLAGS="-pedantic $(AM_CPPFLAGS)"
cd test && $(MAKE) $(AM_MAKEFLAGS) cl_test_monolithic$(EXEEXT) AM_CPPFLAGS="-pedantic $(AM_CPPFLAGS)"
test/cl_test_monolithic$(EXEEXT)
test-pedantic:
$(MAKE) test-do AM_CPPFLAGS=""
test-ascii:
$(MAKE) test-do AM_CPPFLAGS="-D_ASCII"
test-namespace:
$(MAKE) test-do AM_CPPFLAGS="-DDISABLE_NAMESPACE"
test-mmap:
$(MAKE) test-do AM_CPPFLAGS="-DLUCENE_FS_MMAP"
test-mpool:
$(MAKE) test-do AM_CPPFLAGS="-DLUCENE_ENABLE_MEMORY_POOL"
test-mtracking:
$(MAKE) test-do AM_CPPFLAGS="-DLUCENE_ENABLE_MEMLEAKTRACKING"
test-refcnt:
$(MAKE) test-do AM_CPPFLAGS="-DLUCENE_ENABLE_REFCOUNT"
test-minqp:
$(MAKE) test-do AM_CPPFLAGS="-DNO_FUZZY_QUERY -DNO_WILDCARD_QUERY -DNO_PREFIX_QUERY -DNO_RANGE_QUERY"
test-debug:
$(MAKE) test-do AM_CPPFLAGS="-D_DEBUG"
View File
-95
View File
@@ -1,95 +0,0 @@
CLucene README
==============
------------------------------------------------------
CLucene is a C++ port of Lucene.
It is a high-performance, full-featured text search
engine written in C++. CLucene is faster than lucene
as it is written in C++.
------------------------------------------------------
CLucene has contributions from many, see AUTHORS
CLucene is distributed under the GNU Lesser General Public License (LGPL)
*or*
the Apache License, Version 2.0
See the LGPL.license and APACHE.license for the respective license information.
Read COPYING for more about the license.
Installation
------------
* For Linux, MacOSX, cygwin and MinGW build information, read INSTALL.
* Boost.Jam files are provided in the root directory and subdirectories.
* Microsoft Visual Studio (6&7) are provided in the win32 folder.
Mailing List
------------
Questions and discussion should be directed to the CLucene mailing list
at clucene-developers@lists.sourceforge.net
Find subscription instructions at
http://lists.sourceforge.net/lists/listinfo/clucene-developers
Suggestions and bug reports can be made on our bug tracking database
(http://sourceforge.net/tracker/?group_id=80013&atid=558446)
The latest version
------------------
Details of the latest version can be found on the CLucene sourceforge project
web site: http://www.sourceforge.net/projects/clucene
Documentation
-------------
Documentation is provided at http://clucene.sourceforge.net/doc/doxygen/html/
You can also build your own documentation by running doxygen from the root directory
of clucene.
CLucene is a very close port of Java Lucene, so you can also try looking at the
Java Docs on http://lucene.apache.org/java/
Performance
-----------
Very little benchmarking has been done on clucene. Andi Vajda posted some
limited statistics on the clucene list a while ago with the following results.
There are 250 HTML files under $JAVA_HOME/docs/api/java/util for about
6108kb of HTML text.
org.apache.lucene.demo.IndexFiles with java and gcj:
on mac os x 10.3.1 (panther) powerbook g4 1ghz 1gb:
. running with java 1.4.1_01-99 : 20379 ms
. running with gcj 3.3.2 -O2 : 17842 ms
. running clucene 0.8.9's demo : 9930 ms
I recently did some more tests and came up with these rough tests:
663mb (797 files) of Guttenberg texts
on a Pentium 4 running Windows XP with 1 GB of RAM. Indexing max 100,000 fields
• Jlucene: 646453ms. peak mem usage ~72mb, avg ~14mb ram
• Clucene: 232141. peak mem usage ~60, avg ~4mb ram
Searching indexing using 10,000 single word queries
• Jlucene: ~60078ms and used ~13mb ram
• Clucene: ~48359ms and used ~4.2mb ram
Platform notes
--------------
'Too many open files'
Some platforms don't provide enough file handles to run CLucene properly.
To solve this, increase the open file limit:
On Solaris:
ulimit -n 1024
set rlim_fd_cur=1024
Acknowledgments
----------------
The Apache Lucene project is the basis for this software, so the biggest
acknoledgment goes to that project.
We wish to acknowledge the following copyrighted works that
make up portions of the CLucene software:
This software contains code derived from the RSA Data Security
Inc. MD5 Message-Digest Algorithm.
CLucene relies heavily on the use of autoconf and libtool to provide
a build environment.
-3
View File
@@ -1,3 +0,0 @@
The todo list has been moved to the tracker at
http://sourceforge.net/tracker/?func=browse&group_id=80013&atid=558449
-72
View File
@@ -1,72 +0,0 @@
#!/bin/sh
# Bootstrap the CLucene installation.
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=clucene-core
TEST_TYPE=-f
FILE=src/CLucene/StdHeader.h
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to call autogen.sh."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
AUTOMAKE=automake-1.9
ACLOCAL=aclocal-1.9
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
AUTOMAKE=automake
ACLOCAL=aclocal
}
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to call autogen.sh."
echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to call autogen.sh."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
}
if test "$1" = "--clean" || test "$1" = "--clear"; then
make maintainer-clean
rm -fdr build libltdl config autom4te.cache _configs.sed
exit 0
fi
#create the temp gcc config dir
mkdir config 2>/dev/null
set -x
libtoolize --force --copy --ltdl --automake
$ACLOCAL -I m4
autoconf
autoheader
$AUTOMAKE --add-missing --copy
cd "$ORIGDIR"
-530
View File
@@ -1,530 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
-323
View File
@@ -1,323 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
-360
View File
@@ -1,360 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
-267
View File
@@ -1,267 +0,0 @@
dnl ################################################################################
dnl initialize autoconf and automake
dnl ################################################################################
AC_PREREQ([2.57])
AC_INIT(src/CLucene/StdHeader.h)
dnl the clucene-core package version
VERSION=0.9.15
dnl increment if interfaces have been added, removed or changed
clLIB_current=1
dnl increment if source code has changed
dnl - set to zero if current is incremented
clLIB_revision=0
dnl increment if interfaces have been added
dnl - set to zero if interfaces have been removed or changed
clLIB_age=0
CLLIB_VERSION=$clLIB_current:$clLIB_revision:$clLIB_age
AC_SUBST(CLLIB_VERSION)
dnl version info
PACKAGE=clucene-core
PROJECT=CLuceneCore
PACKAGE_BUGREPORT=clucene-developers@lists.sourceforge.net
PACKAGE_NAME=CLuceneCore
PACKAGE_VERSION=$VERSION
AC_CONFIG_SRCDIR([src/CLucene/StdHeader.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADER([config.h.tmp])
AX_PREFIX_CONFIG_H([src/CLucene/clucene-config.h],_CL,[config.h.tmp],
[_ASCII _UCS2 _DEBUG _FILE_OFFSET_BITS _LARGE_FILES uint32_t uint64_t uint8_t int32_t int64_t LUCENE_STATIC_CONSTANT])
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl Check for existence of a C and C++ compilers.
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
dnl Configure libtool.
AC_PROG_LIBTOOL
dnl #######################################################################
dnl # User choices
dnl #######################################################################
AX_CONFIG_FEATURE_DEFAULT_ENABLED
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [build with debugging information]),
[enable_debug=$enableval], [enable_debug=no])
if test $enable_debug = yes; then
AC_DEFINE(_DEBUG, 1, debuging option)
if test $ac_cv_prog_cxx_g = yes; then
CXXFLAGS="-g $CXXFLAGS"
fi
echo "enabling debug"
else
echo disabling debug
fi
AC_ARG_ENABLE(cnddebug,
AC_HELP_STRING([--enable-cnddebug], [build with asserts]),
[enable_cnddebug=$enableval], [enable_cnddebug=no])
if test $enable_cnddebug = yes; then
AC_DEFINE(_CND_DEBUG, 1, [Conditional Debugging])
echo "enabling cnddebug"
else
echo disabling cnddebug
fi
AC_ARG_ENABLE(ascii,
AC_HELP_STRING([--enable-ascii], [Forces into ascii mode]),
[enable_ascii=yes], [enable_ascii=no])
if test $enable_ascii = yes; then
AC_DEFINE(_ASCII, 1, [Forces into Ascii mode])
fi
AC_ARG_ENABLE(multithreading,
AC_HELP_STRING([--disable-multithreading], [disable multithreading]),
[enable_multithreading=no], [enable_multithreading=yes])
if test $enable_multithreading = yes; then
ACX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
CC="$PTHREAD_CC"
echo "enabled multithreading"
else
AC_DEFINE(DISABLE_MULTITHREADING, 1, [Disable multithreading])
echo "disabled multithreading"
fi
AC_ARG_ENABLE(gprof,
AC_HELP_STRING([--enable-gprof], [turn on profiling support]),
[enable_gprof=yes], [enable_gprof=no])
if test $enable_gprof = yes; then
CXXFLAGS="-pg $CPPFLAGS"
LDFLAGS="-pg $LDFLAGS"
echo "enabled gprof"
fi
dnl #######################################################################
dnl # Doxygen Stuff
dnl #######################################################################
AC_CHECK_PROG(DOXYGEN, doxygen, true, false)
if test $DOXYGEN = false; then
AC_MSG_WARN([*** doxygen not found, docs will not be available])
enable_doxygen=no
else
enable_doxygen=yes
AC_CHECK_PROG(DOT, dot, true, false)
if test $DOT = false; then
enable_dot = no;
AC_MSG_WARN([*** dot not found, graphs will not be available])
else
enable_dot = yes;
fi
fi
AC_SUBST(enable_doxygen)
AC_SUBST(enable_dot)
dnl #######################################################################
dnl # Check headers
dnl #######################################################################
dnl Check for headers
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_TIME
dnl check for stl
AC_CXX_HAVE_STL
dnl check for functioning wctype.h
AC_CXX_HAVE_WCTYPE_H
AC_CHECK_HEADERS([algorithm functional map vector list set],,[AC_MSG_ERROR([A required C++ header file is not found.])])
dnl compulsary headers
AC_CHECK_HEADERS([math.h],,[AC_MSG_ERROR([A required C header file is not found.])])
dnl optional headers
AC_CHECK_HEADERS([hash_map hash_set ext/hash_map ext/hash_set stdarg.h sys/timeb.h wchar.h tchar.h errno.h fcntl.h ctype.h inttypes.h sys/types.h])
dnl seems as though c++ headers aren't being checked properly...
AC_DEFINE([HAVE_STDEXCEPT],[],[x])
dnl #######################################################################
dnl # Check for compiler features
dnl #######################################################################
dnl Check for large file support
AC_SYS_LARGEFILE
dnl Check for strange function behaviours
AC_FUNC_STRTOD
dnl check for namespace availability
AC_CXX_NAMESPACES
dnl check for try/catch availability
MDL_CXX_FUNCTION_TRY_BLOCKS
dnl check for std namespace
AC_CXX_HAVE_STD
dnl check for mmap
dnl todo: check that it functions...
case "$host" in
*cygwin*)
AC_CHECK_FUNCS(mmap)
;;
*)
AC_FUNC_MMAP
;;
esac
dnl check for presence of certain optional methods
if test $enable_ascii = yes; then
AC_CHECK_FUNCS(strupr strlwr lltoa strtoll)
else
AC_CHECK_FUNCS(wcscpy wcsupr wcsncpy wcscasecmp wcsicmp wcscat wcschr wcstoll lltow wcstod wcsstr wcslen wcscmp wcsncmp wcscspn)
dnl todo: wcstoq is bsd equiv of wcstoll, we can use that...
fi
dnl always check for file functions
AC_CHECK_FUNCS(tell _filelength)
dnl check for presence of certain compulsary methods
AC_CHECK_FUNCS(printf snprintf,,[AC_MSG_ERROR([A required function is not found.])])
dnl check for broken string functions
dps_swprintf_works
dps_snprintf_oflow
dnl Test for byte<->float conversions
dps_float_byte
dnl Define a valid LUCENE_STATIC_CONSTANT macro
dps_static_const
dnl only try using internal functions if the bugs are not detected
if test $dps_cv_snprintf_bug -eq 0; then
if test $dps_cv_swprintf_works -eq 0; then
AC_CHECK_FUNCS(wprintf snwprintf vsnwprintf)
fi
fi
dnl #######################################################################
dnl # Check for types
dnl #######################################################################
dnl check for functioning long double type
AC_C_LONG_DOUBLE
AC_DEFINE_INTEGER_BITS(uint64_t, unsigned long long, unsigned __int64, unsigned long)
if test "$uint64_t" = no; then
AC_MSG_ERROR([unable to continue without an unsigned 64-bit datatype])
fi
AC_DEFINE_INTEGER_BITS(uint32_t, unsigned int, unsigned long)
if test "$uint32_t" = no; then
AC_MSG_ERROR([unable to continue without an unsigned 32-bit datatype])
fi
AC_DEFINE_INTEGER_BITS(uint8_t, unsigned char)
if test "$uint8_t" = no; then
AC_MSG_ERROR([unable to continue without an unsigned 8-bit datatype])
fi
dnl check for certain types
AC_CHECK_TYPES([float_t],,,[#include <math.h>])
AC_CHECK_TYPES([wchar_t, intptr_t])
dnl #######################################################################
dnl # Other stuff
dnl #######################################################################
dnl Check for nanosleep library
AC_SEARCH_LIBS([nanosleep], [rt],
[AC_DEFINE([HAVE_NANOSLEEP], [1],
[Define if you have the nanosleep function])])
dnl check for endian TODO:
dnl AC_C_BIGENDIAN(AC_DEFINE([IS_BIG_ENDIAN],[],[Define if platform is big endian]),
dnl AC_DEFINE([IS_LITTLE_ENDIAN],[],[Define if platform is little endian]))
dnl #######################################################################
dnl # Finish off
dnl #######################################################################
AC_CONFIG_FILES([Makefile src/Makefile src/demo/Makefile
doc/Makefile win32/Makefile
test/Makefile test/data/Makefile])
AC_OUTPUT([Doxyfile doc/helpheader.htm])
echo "configured $PROJECT version $VERSION"
-9
View File
@@ -1,9 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
docsrcdir = $(top_srcdir)/doc
EXTRA_DIST = $(docsrcdir)/*.txt \
$(docsrcdir)/*.htm \
$(docsrcdir)/*.jpg \
$(docsrcdir)/helpheader.htm.in
MAINTAINERCLEANFILES = Makefile.in
-48
View File
@@ -1,48 +0,0 @@
i realise that these statistics are pretty rough, but i thought in the spirit of doing beat offs on lucene, i'd throw in my search engine into the ring... see what people have to say. i'm not going to attempt to show off using pretty graphs and mean/median/max charts. rather, i am going to hope to get some sort of stability out of doing the same test over and over again - and all tests will be run in one lump, so the start up of the VM will be 'masked' by the amount of time that it runs for.
comparison between apache lucene (i will call it jlucene) and clucene.
machine is a pentium 4 running windows xp with 1gb ram.
indexed data:
indexing 663mb (797 files) of guttenberg texts (some files removed and no graphics,etc):
java notes:
using default memory -Xmx, etc.
I wanted to not put any restrictions on maxFieldsLenght, but it ran out of memory. so i restricted maxFieldLength to 100,000 terms.
used the demo programs. indexing was first run with java maxFieldsLength left at 10,000.
the whole directory was indexed in one hit.
jlucene indexing completed in 136219 ms. peak memory usage ~15mb, average ~12mb
clucene(memory optimized) indexing completed in 53735 ms. peak memory usage ~7.5mb, average ~1.7mb
clucene(speed optimized)
the whole thing was done again, this time setting the maxFieldsLength to 100,000.
jlucene indexing completed in 646453. peak memory usage ~72mb, average ~14mb (when it goes to some of the smaller files)
clucene(memory optimized) indexing completed in 232141. peak memory usage ~~60, average ~4mb (when it goes to some of the smaller files)
clucene(speed optimized)
then i made a text file containing text from the guttenberg collection with 10000 lines. each line represeting one query.
i pruned out key search phrases and punctiuation, etc.
i then modified the demo programs to search for each line of this file. I used the queryParser,
each hits result was iterated through fully (but no text processing or retrieval of the fields was done, just the document).
the 10000 queries were run 4 times each. all java variables were nulled as soon as they were not required anymore.
the search was run on the index created with the previous tests - it was 176mb.
jlucene - searching completed on average 60078ms and used ~13mb for each iteration of 10000 queries.
clucene(memory optimized) searching completed on average 53453ms and used ~4.2mb for each iteration of 10000 queries.
clucene(speed optimized) searching completed on average 52350ms and used ~11mb for each iteration of 10000 queries.
i was a bit dissapointed with the performance gains on the searching side. however, i have only recently begun finetuning
the performance of clucene. i started fine tuning the indexing side of things first - and i am pleased to see the performance
gains - until recently clucene was in the order of 1.8 times faster at indexing.
of course jlucene currently has a much larger group of people working on the code so it stands to reason that there has been
much more performance tuning done. until recently, clucene has basically had next to no time devoted to improving performance, and
this really shows, especially on the search side of things.
i'd like to congratulate lucene and especially doug on an excellent search api!
cheers
ben (clucene)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

-4
View File
@@ -1,4 +0,0 @@
<HR>
<p><a href=http://clucene.sourceforge.net><i>clucene.sourceforge.net</i></a></p>
</BODY>
</HTML>
-23
View File
@@ -1,23 +0,0 @@
<HTML>
<HEAD>
<TITLE>
CLucene API Documentation (Version @VERSION@)
</TITLE>
<META NAME="keywords" CONTENT="CLucene API Documentation (Version @VERSION@)">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="CLucene API Documentation (Version @VERSION@)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<P align=center><B>CLucene - a full-featured, c++ search engine</b><BR>
API Documentation
</P>
<hr>
-173
View File
@@ -1,173 +0,0 @@
This document contains information about the porting status of CLucene<br />
<br />
Platforms and compilers that the CLucene test units work on<br />
<i>Most of these were compiled monolithicly using 'make test-pedantic',
except some platforms which did not have sufficient memory.</i>
<br />
<table border=1 cellpadding=4 cellspacing=0>
<tr>
<td>
<B>Architecture/Platform/compiler</B></td>
<td>
<B>Status</B></td>
<td>
<B>Notes</B></td>
</tr>
<tr>
<td>
x86/WinXP SP2/MSVC6</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/WinXP SP2/MSVC8</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/WinXP SP2/Cygwin</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/WinXP SP2/MinGW32</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/OpenBSD 3.8/GCC 3.3.5</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/FreeBSD 5.4/GCC 3.4.2</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>
x86/NetBSD 2.0.2/GCC 3.3.3</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>x86/Debian 3.1 (Linux 2.6)/GCC 3.3.5
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>x86/Fedora Core 2/GCC 3.3.3
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>x86/Sun Solaris 9/GCC 3.3.2
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>AMD64/Fedora Core 3/GCC 3.4.2
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>x86 64bit/Sun Solaris 10/Forte 10.0
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>PPC/MacOS X 10.2 Server Edition/GCC 3.1
</td>
<td>Pass *
</td>
<td>No wchar.h on this platform, so compiled with --enable-ascii
</td>
</tr>
<tr>
<td>PPC/AIX 5.3/xlc 7.0
</td>
<td>Pass
</td>
<td>System STL didn't work. Compiled using QT's STL.
</td>
</tr>
<tr>
<td>PPC/AIX 5.3/GCC 3.2.3
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>PPC64/SuSE Enterprise Server 9/GCC 3.3.3
</td>
<td>
Pass</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>Sparc/Sun Solaris 9/GCC 3.3.2
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>Sparc/Sun Solaris 8/Forte 10.0
</td>
<td>Pass
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>Alpha/Debian 3.0 (Linux 2.2)/GCC 2.95.4
</td>
<td>
Failed configure*</td>
<td>
Cannot find a working pthread configuration,
wchar related stuff breaks<br />
if configured with pthreads and unicode off, then CLucene's
reliance on exceptions causes unit tests to quit on first
use of an exception. This is a very old gcc though.
</td>
</tr>
</table>
-28
View File
@@ -1,28 +0,0 @@
Tests have been successful on the following platforms:
Win32 (MSVC)
Win32 (Mingw32 based Dev-C++)
Win32 (Cygwin autobuild)
AMD 64 (Fedora Core 3)
x86 (FreeBSD 4.8)
x86 (Fedora Core 2)
IBM Power5 - Suse Enterprise Server 9
Also reported running on:
Mandriva Linux LE 2005.
Too many files open on: (other than that, all tests pass)
NetBSD 1.6.1 - 2 test fail
Sparc - Sun Solaris 9 - 2 test fail
x86 - Sun Solaris 9 - 2 test fail
Current Build Fails On:
Alpha (Linux 2.2, Debian 3.0) - implicit declaration of function `int wcstoll
Currently Tests Fail on:
PPC (Mac OsX 10.1 SERVER) - all tests fail, segfault on highfreq test
PPC (Mac OsX 10.2 SERVER) - segfault on highfreq test
OpenBSD 3.4 - segfaults on highfreq test
-12
View File
@@ -1,12 +0,0 @@
Here is a list of projects, applications or companies which use CLucene.
If you would like to be added to this list, please send me an email:
ustramooner@users.sourceforge.net
Kat (KDE desktop search engine) - http://kat.mandriva.org/
ht://Dig (Intranet/Domain search engine) - http://www.htdig.org/
The Sword Project (Bible tool) - http://www.crosswire.org/
Flock (Firefox based web browser) - http://www.flock.com/developer/
kio-clucene (KDE desktop search engine) - http://kio-clucene.sourceforge.net/
GULP (Das Portal für IT) - http://www.gulp.de/
Rootsweb.com (genealogy website)- http://archiver.rootsweb.com/cgi-bin/search
im-brain (intelligent knowledge management, text classification) - http://www.im-brain.de/
-21
View File
@@ -1,21 +0,0 @@
dnl AC_CXX_HAVE_STD
AC_DEFUN([AC_CXX_HAVE_STD],
[AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,
ac_cv_cxx_have_std,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>
#include <map>
#include <iomanip>
#include <cmath>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[return 0;],
ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_std" = yes; then
AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library])
fi
])
-20
View File
@@ -1,20 +0,0 @@
dnl AC_CXX_HAVE_STL
AC_DEFUN([AC_CXX_HAVE_STL],
[AC_CACHE_CHECK(whether the compiler supports Standard Template Library,
ac_cv_cxx_have_stl,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <list>
#include <deque>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[list<int> x; x.push_back(5);
list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;],
ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_stl" = yes; then
AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library])
fi
])
-16
View File
@@ -1,16 +0,0 @@
dnl AC_CXX_HAVE_WCTYPE_H
AC_DEFUN([AC_CXX_HAVE_WCTYPE_H],
[AC_CACHE_CHECK(for a functioning wctype.h header,
ac_cv_cxx_have_wctype_h,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([#include <wctype.h>
int main(void){ int x=iswalnum(100); return 0;}],
ac_cv_cxx_have_wctype_h=yes, ac_cv_cxx_have_wctype_h=no, ac_cv_cxx_have_wctype_h=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_wctype_h" = yes; then
AC_DEFINE(HAVE_WCTYPE_H,,[Define to 1 if you have a functioning <wchar.h> header file.])
fi
])
-15
View File
@@ -1,15 +0,0 @@
dnl AC_CXX_NAMESPACES
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])
@@ -1,32 +0,0 @@
dnl AC_DEFINE_INTEGER_BITS
AC_DEFUN([AC_DEFINE_INTEGER_BITS],
[m4_define([ac_datatype_bits], [m4_translit($1, [a-zA-Z_])])
m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
AC_CHECK_TYPE($1, ,
[
AC_MSG_NOTICE([trying to find a suitable ]ac_datatype_bytes[-byte replacement for $1])
$1=no
find_$1 ()
{
_AC_DEFINE_INTEGER_BITS_HELPER($@)
:
}
find_$1
AC_DEFINE_UNQUOTED($1, $$1,
[If not already defined, then define as a datatype of *exactly* ]ac_datatype_bits[ bits.])
])
])
dnl Iterate over arguments $2..$N, trying to find a good match for $1.
m4_define([_AC_DEFINE_INTEGER_BITS_HELPER],
[ifelse($2, , ,
[m4_define([ac_datatype_bits], [m4_translit($1, [a-zA-Z_])])
m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
AC_CHECK_SIZEOF($2)
if test "$AS_TR_SH(ac_cv_sizeof_$2)" -eq ac_datatype_bytes; then
$1="$2"
return
fi
_AC_DEFINE_INTEGER_BITS_HELPER($1, m4_shift(m4_shift($@)))
])
])
-234
View File
@@ -1,234 +0,0 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://autoconf-archive.cryp.to/acx_pthread.html
dnl Version: 2005-06-15
dnl
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
if test x"$acx_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th=pthread_self(); pthread_attr_t attr;pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_mutex_t mtx; pthread_mutex_init(&mtx,0);
pthread_mutex_lock(&mtx); pthread_mutex_unlock(&mtx);
pthread_mutex_destroy(&mtx) ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT($flag)
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
dnl Check for recursive mutex support (per SUSv3).
AC_MSG_CHECKING([for recursive mutex support])
AC_TRY_RUN([#include <sys/types.h>
#include <pthread.h>
#include <stdlib.h>
int main() {
pthread_mutexattr_t attr;
pthread_mutex_t m;
exit (pthread_mutexattr_init(&attr)
|| pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)
|| pthread_mutex_init(&m, &attr));
}], [acx_pthreads_recursive=yes], [acx_pthreads_recursive=no])
dnl NOTE: pthread_mutexattr_setkind_np is the deprecated name for pthread_mutexattr_settype. old compilers might need it
if test "$acx_pthreads_recursive" = "yes"; then
AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
[Define if recursive pthread mutexes are available])
fi
AC_MSG_RESULT($acx_pthreads_recursive)
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
case $host in
*-*-mingw32*)
AC_MSG_RESULT([MINGW32: use windows threading library!])
;;
*)
AC_MSG_ERROR([Cannot find a working pthread configuration. If you think this is wrong, please review acx_pthread.m4 and report the problem])
;;
esac
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD
-65
View File
@@ -1,65 +0,0 @@
dnl AX_CONFIG_FEATURE
AC_DEFUN([AX_CONFIG_FEATURE],[ dnl
m4_pushdef([FEATURE], patsubst([$1], -, _))dnl
AC_ARG_ENABLE([$1],AC_HELP_STRING([--enable-$1],[$2]),[
case "${enableval}" in
yes)
ax_config_feature_[]FEATURE[]="yes"
;;
no)
ax_config_feature_[]FEATURE[]="no"
;;
*)
AC_MSG_ERROR([bad value ${enableval} for feature --$1])
;;
esac
])
AS_IF([test "$ax_config_feature_[]FEATURE[]" = yes],[ dnl
AC_DEFINE([$3])
$5
AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl
AC_MSG_NOTICE([Feature $1 is enabled])
])
],[ dnl
$6
AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl
AC_MSG_NOTICE([Feature $1 is disabled])
])
])
AH_TEMPLATE([$3],[$4])
m4_popdef([FEATURE])dnl
])
dnl Feature global
AC_DEFUN([AX_CONFIG_FEATURE_VERBOSE],[ dnl
ax_config_feature_verbose=yes
])
dnl Feature global
AC_DEFUN([AX_CONFIG_FEATURE_SILENT],[ dnl
ax_config_feature_verbose=no
])
dnl Feature specific
AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_ENABLED], [
ax_config_feature_[]FEATURE[]_default=yes
])
dnl Feature specific
AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_DISABLED], [
ax_config_feature_[]FEATURE[]_default=no
])
dnl Feature specific
AC_DEFUN([AX_CONFIG_FEATURE_ENABLE],[ dnl
ax_config_feature_[]patsubst([$1], -, _)[]=yes
])
dnl Feature specific
AC_DEFUN([AX_CONFIG_FEATURE_DISABLE],[ dnl
ax_config_feature_[]patsubst([$1], -, _)[]=yes
])
-195
View File
@@ -1,195 +0,0 @@
dnl @synopsis AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
dnl
dnl This is a new variant from ac_prefix_config_ this one will use a
dnl lowercase-prefix if the config-define was starting with a
dnl lowercase-char, e.g. "#define const", "#define restrict", or
dnl "#define off_t", (and this one can live in another directory, e.g.
dnl testpkg/config.h therefore I decided to move the output-header to
dnl be the first arg)
dnl
dnl takes the usual config.h generated header file; looks for each of
dnl the generated "#define SOMEDEF" lines, and prefixes the defined
dnl name (ie. makes it "#define PREFIX_SOMEDEF". The result is written
dnl to the output config.header file. The PREFIX is converted to
dnl uppercase for the conversions.
dnl
dnl Defaults:
dnl
dnl OUTPUT-HEADER = $PACKAGE-config.h
dnl PREFIX = $PACKAGE
dnl ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
dnl
dnl Your configure.ac script should contain both macros in this order,
dnl and unlike the earlier variations of this prefix-macro it is okay
dnl to place the AX_PREFIX_CONFIG_H call before the AC_OUTPUT
dnl invokation.
dnl
dnl Example:
dnl
dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader"
dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
dnl AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
dnl AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
dnl AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
dnl AC_C_CONST_H # makes "#undef const"
dnl AC_OUTPUT(Makefile) # creates the "config.h" now
dnl # and also mylib/_config.h
dnl
dnl if the argument to AX_PREFIX_CONFIG_H would have been omitted then
dnl the default outputfile would have been called simply
dnl "testpkg-config.h", but even under the name "mylib/_config.h" it
dnl contains prefix-defines like
dnl
dnl #ifndef TESTPKG_VERSION
dnl #define TESTPKG_VERSION "0.1.1"
dnl #endif
dnl #ifndef TESTPKG_NEED_MEMORY_H
dnl #define TESTPKG_NEED_MEMORY_H 1
dnl #endif
dnl #ifndef _testpkg_const
dnl #define _testpkg_const _const
dnl #endif
dnl
dnl and this "mylib/_config.h" can be installed along with other
dnl header-files, which is most convenient when creating a shared
dnl library (that has some headers) where some functionality is
dnl dependent on the OS-features detected at compile-time. No need to
dnl invent some "mylib-confdefs.h.in" manually. :-)
dnl
dnl Note that some AC_DEFINEs that end up in the config.h file are
dnl actually self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the
dnl AC_TYPE_OFF_T say that they "will define inline|const|off_t if the
dnl system does not do it by itself". You might want to clean up about
dnl these - consider an extra mylib/conf.h that reads something like:
dnl
dnl #include <mylib/_config.h>
dnl #ifndef _testpkg_const
dnl #define _testpkg_const const
dnl #endif
dnl
dnl and then start using _testpkg_const in the header files. That is
dnl also a good thing to differentiate whether some library-user has
dnl starting to take up with a different compiler, so perhaps it could
dnl read something like this:
dnl
dnl #ifdef _MSC_VER
dnl #include <mylib/_msvc.h>
dnl #else
dnl #include <mylib/_config.h>
dnl #endif
dnl #ifndef _testpkg_const
dnl #define _testpkg_const const
dnl #endif
dnl
dnl Modified by Ben van Klinken for CLucene. Added a 4th parameter which
dnl should be a list of parameters that should not be prefixed. This
dnl simplifies the usage by not requiring some of the previously documented
dnl workarounds.
dnl
dnl @category Misc
dnl @author Guido Draheim <guidod@gmx.de>
dnl @author Mårten Svantesson <msv@kth.se>
dnl @version 2005-06-08
dnl @license GPLWithACException
AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER])
AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
AS_VAR_PUSHDEF([_IGN],[ac_prefix_conf_IGN])dnl
AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
m4_pushdef([_script],[conftest.prefix])dnl
m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
_OUT=`printf '%s\n' ifelse($1, , $PACKAGE-config.h, $1)`
_DEF=`printf '%s\n' _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
_PKG=`printf '%s\n' ifelse($2, , $PACKAGE, $2)`
_LOW=`printf '%s\n' _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
_UPP=`printf '%s\n' $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
_IGN="$4"
_INP=`printf '%s\n' "ifelse($3,,,$3)" | sed -e 's/ *//'`
if test ".$_INP" = "."; then
for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
case "$ac_file" in
*.h) _INP=$ac_file ;;
*)
esac
test ".$_INP" != "." && break
done
fi
if test ".$_INP" = "."; then
case "$_OUT" in
*/*) _INP=`basename "$_OUT"`
;;
*-*) _INP=`printf '%s\n' "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
;;
*) _INP=config.h
;;
esac
fi
if test -z "$_PKG" ; then
AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
else
if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
_INP="$srcdir/$_INP"
fi fi
AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
if test -f $_INP ; then
printf '%s\n' "s/@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
printf '%s\n' "s/@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
printf '%s\n' "s/@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
printf '%s\n' "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
printf '%s\n' "@%:@endif/" >>_script
printf '%s\n' "s/@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
printf '%s\n' "@%:@define $_LOW""_\\1 \\2 \\" >> _script
printf '%s\n' "@%:@endif/" >> _script
#take 4th parameter for the ignore list.
#goes through the list and reverts each item back to its original state
#works for both upper and lower case prefixes
for _IGNx in $_IGN; do
printf '%s\n' "s/#ifndef $ac_prefix_conf_LOW""_$_IGNx/#ifndef $_IGNx/" >> conftest.prefix
printf '%s\n' "s/#define $ac_prefix_conf_LOW""_$_IGNx/#define $_IGNx/" >> conftest.prefix
printf '%s\n' "s/#undef $ac_prefix_conf_LOW""_$_IGNx/#undef $_IGNx/" >> conftest.prefix
printf '%s\n' "s/#ifndef $ac_prefix_conf_UPP""_$_IGNx/#ifndef $_IGNx/" >> conftest.prefix
printf '%s\n' "s/#define $ac_prefix_conf_UPP""_$_IGNx/#define $_IGNx/" >> conftest.prefix
printf '%s\n' "s/#undef $ac_prefix_conf_UPP""_$_IGNx/#undef $_IGNx/" >> conftest.prefix
done
# now executing _script on _DEF input to create _OUT output file
printf '%s\n' "@%:@ifndef $_DEF" >$tmp/pconfig.h
printf '%s\n' "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
printf '%s\n' ' ' >>$tmp/pconfig.h
printf '%s\n' /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
sed -f _script $_INP >>$tmp/pconfig.h
printf '%s\n' ' ' >>$tmp/pconfig.h
printf '%s\n' '/* once:' $_DEF '*/' >>$tmp/pconfig.h
printf '%s\n' "@%:@endif" >>$tmp/pconfig.h
if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
AC_MSG_NOTICE([$_OUT is unchanged])
else
ac_dir=`AS_DIRNAME(["$_OUT"])`
AS_MKDIR_P(["$ac_dir"])
rm -f "$_OUT"
mv $tmp/pconfig.h "$_OUT"
fi
cp _script _configs.sed
else
AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
fi
rm -f conftest.*
fi
m4_popdef([_symbol])dnl
m4_popdef([_script])dnl
AS_VAR_POPDEF([_INP])dnl
AS_VAR_POPDEF([_UPP])dnl
AS_VAR_POPDEF([_LOW])dnl
AS_VAR_POPDEF([_IGN])dnl
AS_VAR_POPDEF([_PKG])dnl
AS_VAR_POPDEF([_DEF])dnl
AS_VAR_POPDEF([_OUT])dnl
],[PACKAGE="$PACKAGE"])])
-100
View File
@@ -1,100 +0,0 @@
dnl dps_float_byte
AC_DEFUN([dps_float_byte],
[AC_MSG_CHECKING(whether ${CXX} supports our byte<->float conversions)
AC_CACHE_VAL(mdl_cv_have_float_byte_support,
[ AC_TRY_RUN(
changequote(<:<, >:>)dnl
<:<
typedef long double float_t;
typedef long int32_t;
typedef char uint8_t;
//float to bits conversion utilities...
union clvalue {
int32_t i;
float f; //must use a float type, else types dont match up
};
int32_t floatToIntBits(float_t value)
{
clvalue u;
int32_t e, f;
u.f = value;
e = u.i & 0x7f800000;
f = u.i & 0x007fffff;
if (e == 0x7f800000 && f != 0)
u.i = 0x7fc00000;
return u.i;
}
float_t intBitsToFloat(int32_t bits)
{
clvalue u;
u.i = bits;
return u.f;
}
float_t byteToFloat(uint8_t b) {
if (b == 0) // zero is a special case
return 0.0f;
int32_t mantissa = b & 7;
int32_t exponent = (b >> 3) & 31;
int32_t bits = ((exponent+(63-15)) << 24) | (mantissa << 21);
return intBitsToFloat(bits);
}
uint8_t floatToByte(float_t f) {
if (f < 0.0f) // round negatives up to zero
f = 0.0f;
if (f == 0.0f) // zero is a special case
return 0;
int32_t bits = floatToIntBits(f); // parse float_t into parts
int32_t mantissa = (bits & 0xffffff) >> 21;
int32_t exponent = (((bits >> 24) & 0x7f) - 63) + 15;
if (exponent > 31) { // overflow: use max value
exponent = 31;
mantissa = 7;
}
if (exponent < 0) { // underflow: use min value
exponent = 0;
mantissa = 1;
}
return (uint8_t)((exponent << 3) | mantissa); // pack into a uint8_t
}
int main(void)
{
//well know conversion
if ( floatToByte(0.5f) != 120 )
return 1;
//converting back works?
if ( floatToByte(byteToFloat(57)) != 57 )
return 1;
return 0;
}
>:>
changequote([, ]), dps_float_byte_fail=0, dps_float_byte_fail=1,
dps_float_byte_fail=2
)]
)
if test $dps_float_byte_fail -eq 0; then
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_FUNCTIONING_FLOAT_BYTE], [], [Does not support new float byte<->float conversions])
elif test $dps_float_byte_fail -eq 1; then
AC_MSG_RESULT([no])
AC_DEFINE([HAVE_NO_FLOAT_BYTE], [], [Does not support new float byte<->float conversions])
else
AC_MSG_RESULT([unknown, assuming broken])
AC_DEFINE([HAVE_NO_FLOAT_BYTE], [], [Does not support new float byte<->float conversions])
fi
])
-41
View File
@@ -1,41 +0,0 @@
dnl dps_snprintf_oflow
AC_DEFUN([dps_snprintf_oflow],
[AC_MSG_CHECKING(whether snprintf ignores n)
AC_CACHE_VAL(dps_cv_snprintf_bug,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<<#include <stdio.h>
#ifndef HAVE_SNPRINTF
#ifdef HAVE_VSNPRINTF
#include "vsnprintf.h"
#else /* not HAVE_VSNPRINTF */
#include "vsnprintf.c"
#endif /* HAVE_VSNPRINTF */
#endif /* HAVE_SNPRINTF */
int main(void)
{
char ovbuf[7];
int i;
for (i=0; i<7; i++) ovbuf[i]='x';
snprintf(ovbuf, 4,"foo%s", "bar");
if (ovbuf[5]!='x') exit(1);
snprintf(ovbuf, 4,"foo%d", 666);
if (ovbuf[5]!='x') exit(1);
exit(0);
} >>
changequote([, ]), dps_cv_snprintf_bug=0, dps_cv_snprintf_bug=1,
dps_cv_snprintf_bug=2
)
])
if test $dps_cv_snprintf_bug -eq 0; then
AC_MSG_RESULT([no, snprintf is ok])
elif test $dps_cv_snprintf_bug -eq 1; then
AC_MSG_RESULT([yes, snprintf is broken])
AC_DEFINE([HAVE_SNPRINTF_BUG],[][Defined if the snprintf overflow test fails])
else
AC_MSG_RESULT([unknown, assuming yes])
AC_DEFINE([HAVE_SNPRINTF_BUG],[],[Defined if the snprintf overflow test fails])
fi
])
@@ -1,33 +0,0 @@
dnl dps_static_const
AC_DEFUN([dps_static_const],
[AC_MSG_CHECKING(whether ${CXX} supports static const definitions in classes)
AC_CACHE_VAL(dps_static_const_type,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([class x{public: static const int SCI=55; }; int main(){ x a; if ( a.SCI!=55 ) throw "err"; }],
dps_static_const_type=1,
dps_static_const_type=0,
dps_static_const_type=0)
if test $dps_static_const_type -eq 0; then
AC_TRY_RUN([class x{public: enum{ SCI=55 }; }; int main(){ x a; if ( a.SCI!=55 ) throw "err"; }],
dps_static_const_type=2,
dps_static_const_type=0,
dps_static_const_type=0)
fi
AC_LANG_RESTORE
])
if test $dps_static_const_type -eq 1; then
AC_MSG_RESULT([yes])
AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 1, [How to define a static const in a class])
elif test $dps_static_const_type -eq 2; then
AC_MSG_RESULT([yes])
AC_DEFINE([LUCENE_STATIC_CONSTANT_SYNTAX], 2, [How to define a static const in a class])
else
AC_MSG_ERROR([Cannot figure out how to write static consts in classes. Check the m4 script or upgrade your compiler])
fi
])
-31
View File
@@ -1,31 +0,0 @@
dnl dps_swprintf_works
AC_DEFUN([dps_swprintf_works],
[AC_MSG_CHECKING(whether swprintf is broken)
AC_CACHE_VAL(dps_cv_swprintf_works,
[ AC_TRY_RUN(
changequote(<<, >>)dnl
<<#include <stdio.h>
#include <wchar.h>
int main(void)
{
wchar_t buf[5];
swprintf(buf,5,L"%s",L"foo");
if ( wcslen(buf) != 3 )
exit(1);
exit(0);
} >>
changequote([, ]), dps_cv_swprintf_works=0, dps_cv_swprintf_works=1,
dps_cv_swprintf_works=2
)]
)
if test $dps_cv_swprintf_works -eq 0; then
AC_MSG_RESULT([no, swprintf is ok])
elif test $dps_cv_swprintf_works -eq 1; then
AC_MSG_RESULT([yes, swprintf is broken])
AC_DEFINE([HAVE_SWPRINTF_BUG],[],[Defined if the swprintf test fails])
else
AC_MSG_RESULT([unknown, assuming yes])
AC_DEFINE([HAVE_SWPRINTF_BUG],[],[Defined if the swprintf test fails])
fi
])
@@ -1,19 +0,0 @@
dnl MDL_CXX_FUNCTION_TRY_BLOCKS
AC_DEFUN([MDL_CXX_FUNCTION_TRY_BLOCKS],
[
AC_REQUIRE([AC_PROG_CXX])
AC_MSG_CHECKING(whether ${CXX} supports function try blocks)
AC_CACHE_VAL(mdl_cv_have_function_try_blocks,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([void foo() try{} catch( ... ){}],
[foo();],
mdl_cv_have_function_try_blocks=yes,
mdl_cv_have_function_try_blocks=no)
AC_LANG_RESTORE
])
AC_MSG_RESULT($mdl_cv_have_function_try_blocks)
if test "$mdl_cv_have_function_try_blocks" = no; then
AC_DEFINE([HAVE_NO_FUNCTION_TRY_BLOCKS], [], [Does not support try/catch blocks])
fi])
-2
View File
@@ -1,2 +0,0 @@
-37
View File
@@ -1,37 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
//Includes some standard headers for searching and indexing.
#ifndef _lucene_CLucene_
#define _lucene_CLucene_
#include "CLucene/StdHeader.h"
#include "CLucene/debug/condition.h"
#include "CLucene/debug/mem.h"
#include "CLucene/index/IndexReader.h"
#include "CLucene/index/IndexWriter.h"
#include "CLucene/index/MultiReader.h"
#include "CLucene/index/Term.h"
#include "CLucene/search/IndexSearcher.h"
#include "CLucene/search/MultiSearcher.h"
#include "CLucene/search/DateFilter.h"
#include "CLucene/search/WildcardQuery.h"
#include "CLucene/search/FuzzyQuery.h"
#include "CLucene/search/PhraseQuery.h"
#include "CLucene/search/PrefixQuery.h"
#include "CLucene/search/RangeQuery.h"
#include "CLucene/search/BooleanQuery.h"
#include "CLucene/document/Document.h"
#include "CLucene/document/Field.h"
#include "CLucene/document/DateField.h"
#include "CLucene/store/Directory.h"
#include "CLucene/store/FSDirectory.h"
#include "CLucene/queryParser/QueryParser.h"
#include "CLucene/analysis/standard/StandardAnalyzer.h"
#include "CLucene/analysis/Analyzers.h"
#include "CLucene/util/Reader.h"
#endif
-87
View File
@@ -1,87 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _clucene_backwards_h
#define _clucene_backwards_h
//In light of the recent major changes to clucene,
//this file should help to maintain some backwards compatibility
//include it after including StdHeader.h
//
//Note: I haven't tested this much, so please send me your changes
//dirent is one of the most major changes that won't easily port.
//you can use the TCHAR copying macros, STRCPY_TtoA and STRCPY_AtoT
//to copy between different character types.
//If you use stringPrintF, you will need to add the target string
//size parameter, because it is using _sntprintf... Change this if you
//want, but _sntprintf is much safer
#define char_t TCHAR
#define uchar_t TCHAR
#define l_byte_t byte_t
//#define stringSpn _tcsspn //not used in clucene anymore
#define stringCSpn _tcscspn
#define stringLength _tcslen
//#define stringToInteger _ttoi //not used in clucene anymore, use integer w/ base
#define stringFind _tcsstr
#define stringFindChar _tcschr
#define stringCompare _tcscmp
#define stringNCopy _tcsncpy
#define stringCopy _tcscpy
#define stringCat _tcscat
//#define stringToken _tcstok //not used in clucene anymore
#define stringPrintF _sntprintf //you will have errors, because now we used printf w/ bufferlen count
#define printFormatted _tprintf
//conversion functions
#define integerToString _i64tot
#define stringToIntegerBase _tcstoi64
#define stringToFloat _tcstod
//file find structures
#define Cmd_Stat fileStat
#define Struct_Stat fileStat
#define stringICompare _tcsicmp
#define stringNCompare _tcsncmp
#define stringDifference _tcscmp
//character conversion functions
#define isSpace _istspace
#define isDigit _istwdigit
#define isAlNum _istwalnum
#define toLower _totlower
#define stringUpper _tcsupr
//#define stringLower _tcslwr //not used in clucene anymore
#define _THROWX(y) _THROWT(y)
#define _THROWC(y) _THROWA(y)
//file naming stuff - remember we have changed all names to file naming lower case
#define fileRename _rename
#define fileFullName(abs,rel) _realpath(rel,abs)
#define makeDirectory _tmkdir
#define unlinkFile _unlink
//no longer supported definitions
#ifdef _UNICODE
#define TO_CHAR_T STRDUP_AtoT
#define _cout wcout
#define _cin wcin
#define _cerr wcerr
#else
#define TO_CHAR_T STRDUP_WtoT
#define _cout cout
#define _cin cin
#define _cerr cerr
#endif
//some headers that used to be automatically included:
#include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used
#endif
-343
View File
@@ -1,343 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_Config_
#define _lucene_Config_
////////////////////////////////////////////////////////////////////
// this settings should be set up in the compiler,
// but are put here for reference as to what could be defined
////////////////////////////////////////////////////////////////////
//
//define this if you want debugging code to be enabled
//#define _DEBUG
//
//define this if you want condition debugging to be enabled
#if defined(_DEBUG) && !defined(_CL__CND_DEBUG)
#define _CL__CND_DEBUG
#endif
//
//define this to print out lots of information about merges, etc
//requires __CL__CND_DEBUG to be defined
//#define _CL_DEBUG_INFO stdout
//
//to disable namespaces define this
//#define DISABLE_NAMESPACE
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// These options can be set depending on the particular needs of
// Your application
////////////////////////////////////////////////////////////////////
//
//define this to force the build into ascii mode
//#define _ASCII
//
//define this to force the build into ucs2 mode
//#define _UCS2
//
//if a wide character is being converted to a ascii character and it
//cannot fit, this character is used instead. Required.
#define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF))
//
//define if you would like to force clucene to use the internal
//character functions.
//Tests may display unpredictable behaviour if this is not defined.
#define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
//
//define this to enable mmap support in the fsdirectory IndexInput
//todo: only available for windows so far...need to add MMapInput.cpp to project
//EXPERIMENTAL
//#define LUCENE_FS_MMAP
//
//LOCK_DIR implementation:
//define this to set an exact directory for the lock dir (not recommended)
//all other methods of getting the temporary directory will be ignored
//#define LUCENE_LOCK_DIR "/tmp"
//
//define this to try and load the lock dir from this specified environment variable
#define LUCENE_LOCK_DIR_ENV_1 "TEMP"
//define this if you want to have look up this environment variable if the first one fails
#define LUCENE_LOCK_DIR_ENV_2 "TMP"
//define this if you want to have a fallback directory, if not defined then
//the lockdirectory will be the index directory
#define LUCENE_LOCK_DIR_ENV_FALLBACK "/tmp"
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// The following are search query options
// THe NO_* options can make CLucene faster and/or smaller
// special queries sometime require longer search times or may
// not be required
////////////////////////////////////////////////////////////////////
//
//Define this to remove fuzzy query and sloppy scoring
//#define NO_FUZZY_QUERY
//
//Define to remove wildcard t*m or te?m to match term
//#define NO_WILDCARD_QUERY
//
//Define to remove prefix term query - ter* to match term or terms
//#define NO_PREFIX_QUERY
//
//Define to remove range (exlusive and inclusive)
//#define NO_RANGE_QUERY
//
//This must always be defined. They can be adjusted if required. But
//general Wildcard string would be '*' and Wildcard Char would be '?'
//Both are Required.
#define LUCENE_WILDCARDTERMENUM_WILDCARD_STRING '*'
#define LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR '?'
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// memory handling configurations
////////////////////////////////////////////////////////////////////
//
//If this is defined, lucene's configurations are changed
//to use less memory, but may run slower.
//todo: i dont think this actualy changes speed much, just memory
#define LUCENE_OPTIMIZE_FOR_MEMORY
//
//enable this if you want to enable lucene's memory pool.
//The memory pooling can greatly increase clucene by
//putting certain classes that are allocated and deallocated
//a lot into a memory pool. This method will use more memory,
//because it does not return the memory back to the application.
//Using memory pooling is difficult for
//debugging, so only use it for releases. To 'free' the used
//memory pool, call lucene_release_memory_pool...
//To add another class to the memory pool you need to change
//the LUCENE_BASE class to LUCENE_POOLEDBASE(cls) and the
//LUCENE_MP_DEFINE(ns,cls) added just before the class.
//In lucenebase.cpp add the implementations to the top of the
//file. And in the lucene_release_memory_pool, add the RELEASE_MP
//line (so that that memory pool will be deleted) and include
//the header for the class into lucenebase.cpp
//Note: If you use this, you may want to call lucene_release_memory_pool
//after doing memory intensive calls. This is a bit like doing manual
//"garbage collection"
//Todo: this method is horriblly implemented. ideally, there should
//be only 1 memory pool. If anyone wants to look into combining the
//memory pool, please do
#if !defined(_DEBUG) && !defined(LUCENE_OPTIMIZE_FOR_MEMORY) && !defined(LUCENE_ENABLE_MEMORY_POOL)
//#define LUCENE_ENABLE_MEMORY_POOL
#endif
//
//define this if you want the pointer tracking to be enabled
//this is a useful tool for memory leak tracking
//The LuceneBase can slow down the code a *lot*
//todo: currently cant be used with mempool...
#if defined(_DEBUG) && !defined(LUCENE_ENABLE_MEMORY_POOL)
#if !defined(LUCENE_DISABLE_MEMTRACKING) && !defined(LUCENE_ENABLE_MEMLEAKTRACKING)
#define LUCENE_ENABLE_MEMLEAKTRACKING
#endif
#endif
//
//enable use of rich file/line tracking. use CL_FILELINE to pass
//to functions like stringDuplicate (or use CL_STRDUP* functions instead) and
//CLStringIntern::x.
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
#define LUCENE_ENABLE_FILELINEINFO
#endif
//
//enable creation of clucene.log file. Logs every
//call to new operator. Must have LUCENE_ENABLE_MEMLEAKTRACKING enabled.
//writes log in this format.
//action,file name,file line,allocation size
//logging can be disabled by setting _lucene_disable_debuglogging to true
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) && defined(_DEBUG)
//#define LUCENE_ENABLE_CONSTRUCTOR_LOG
#endif
//
//
//enable this if you want to enable reference counting. This is
//not necessary or useful in most cases except when implementing wrappers
//which have reference counting. If the wrapper wraps a StringReader,
//for example, it should expect that the wrapped StringReader should not
//be deleted. However, when the stringreader is added into a Field,
//the Field usually takes over the stringReader and deletes it on completion.
//If reference counting is enabled, the wrapper can add a reference to any class
//and when _CLDECDELETE is called, the reference is decremented and only deleted
//if the refcount is zero.
//#define LUCENE_ENABLE_REFCOUNT
////////////////////////////////////////////////////////////////////
// These options allow you to remove certain implementations
// out of clucene so that they can be implemented in the client
// application
////////////////////////////////////////////////////////////////////
//
//define this to your own setting if you would like to implement your own
//threading locking code. it should have the same sort of functions as
//mutex_default. If not defined, clucene will try and use posix,win32 critical
//sections, or a timer based mutex hack.
//#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_default
//
//define this if you want to implement the _Cnd_OutDebug routine yourself
//you can then easily customise in your own application how to handle debug messages
//#define _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG
//
//define this if you want to implement your own namespace macros
//#define _LUCENE_DONTIMPLEMENT_NS_MACROS
//
//define this if you do not want clucene to include any standard libraries.
//this could be useful if you want to use alternate libraries
//#define LUCENE_DISABLE_INCLUDES
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// These options will be changed depending on your compiler/platform
// but can also be changed here if required
////////////////////////////////////////////////////////////////////
//
//define this if multi-threading support is not required
//if not defined, multi-thread locking will
//occur (and its related processing overhead)
//note: it is recommended to disable multithreading if you do not need it
//there is a lot of overhead that can be avoided.
//#define _CL_DISABLE_MULTITHREADING
//
//if you want to define your own default file encoding. specify it
//here - normally defined in the platform specific headers
//#define PLATFORM_DEFAULT_READER_ENCODING CL_NS(util)::FileReader::ENCODING_ASCII
//
//disable hash implementations (if available)
//#define LUCENE_DISABLE_HASHING
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// These options should not be changed. But you can experiment with
// them to optimize performance
////////////////////////////////////////////////////////////////////
//
//some defaults, wouldn't usually need to be changed
//Buffer size for input/output streams. Required.
//todo: change this to BufferedIndexOutput::BUFFER_SIZE
#define LUCENE_STREAM_BUFFER_SIZE 1024
//
// DSR:2004.08.19:
// Formerly, StringBuffer used 1024 as the default size of its internal buffer.
// However, StringBuffer is used primarily for token- and term-oriented
// processing, e.g. in StandardTokenizer. I've calculated that the average
// token (as produced by StandardTokenizer) in all .txt files distributed in
// the Project Gutenberg CD Image (August 2003 release) has only 6 characters.
// Although most languages are likely to have a longer average word length than
// English due to the popularity of "non-atomized" conjugation and declension
// mechanisms, 1024 is still vastly excessive.
// I made two changes intended to deliver better overall performance:
// a) Switched to a default StringBuffer character capacity of 32. Though 32
// is longer than the average token, the high cost of realloc makes a
// slightly liberal default size optimal. I chose the default size of 32
// after fairly extensive experimentation on the Gutenberg e-texts. The
// results are summarized in the following table:
// ------------------------------------------------------------------------
// LUCENE_DEFAULT_TOKEN_BUFFER_SIZE value | % faster than default size 1024
// ------------------------------------------------------------------------
// 8 : 4%
// 16 : 7%
// 32 : 6%
// 64 : 3%
// A default size of 32 is actually slightly slower than 16, but I was
// experimenting on English text; I expect that 32 will maintain decent
// performance in languages such as German, and in technical documents
// with long tokens.
//
// b) To offset the switch to a smaller default buffer size, I implemented a
// more aggressive growth strategy. A StringBuffer now [at least] doubles
// the size of its internal buffer every time it needs to grow, rather
// than [at least] increasing by LUCENE_DEFAULT_TOKEN_BUFFER_SIZE no
// matter how many times it has already grown.
//Required.
#define LUCENE_DEFAULT_TOKEN_BUFFER_SIZE 32
//todo: should implement a similar strategy in analysis/token
//
//Expert: The fraction of terms in the "dictionary" which should be stored
//in RAM. Smaller values use more memory, but make searching slightly
//faster, while larger values use less memory and make searching slightly
//slower. Searching is typically not dominated by dictionary lookup, so
//tweaking this is rarely useful.
#define LUCENE_DEFAULT_WRITER_INDEX_INTERVAL 128
//
//Expert: The fraction of {@link TermDocs} entries stored in skip tables,
//used to accellerate {@link TermDocs#skipTo(int)}. Larger values result in
//smaller indices, greater acceleration, but fewer accelerable cases, while
//smaller values result in bigger indices, less acceleration and more
//accelerable cases. More detailed experiments would be useful here. */
#define LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL 16
//
//Size of TermScore cache. Required.
#define LUCENE_SCORE_CACHE_SIZE 32
//
//analysis options
//maximum length that the CharTokenizer uses. Required.
//By adjusting this value, you can greatly improve the performance of searching
//and especially indexing. Default is 255, but smaller numbers will decrease
//the amount of memory used as well as increasing the speed.
#define LUCENE_MAX_WORD_LEN 255
//Maximum length of a token word.
//Should be the same or more than LUCENE_MAX_WORD_LEN
//if not defined, then no token limit, but may be slower
//if defined will be faster (up to 15% in some cases), but will use more memory
#ifndef LUCENE_OPTIMIZE_FOR_MEMORY
#define LUCENE_TOKEN_WORD_LENGTH LUCENE_MAX_WORD_LEN
#endif
//
//maximum field length. some optimisation can be done if a maximum field
//length is given... The smaller the better
#define LUCENE_MAX_FIELD_LEN 100
//
//Determines the minimal number of documents required before the buffered
//in-memory documents are merging and a new Segment is created.
//See IndexWriter.h for more info. Required. Default=10
#define LUCENE_INDEXWRITER_DEFAULT_MIN_MERGE_DOCS 10
//
//The initial value set to BooleanQuery::maxClauseCount. Default is 1024
#define LUCENE_BOOLEANQUERY_MAXCLAUSECOUNT 1024
//
//bvk: 12.3.2005
//==============================================================================
//Previously the way the tokenizer has worked has been changed to optionally
//use a a fixed word length. I have implemented this in the Term class as well.
//It seems that by predefining the text length instead of using new TCHAR[x]
//in the constructor greatly improves the performance by 20-30% for certain
//operations.
//Maximum length of a term text.
//Should be the same or more than LUCENE_MAX_WORD_LEN
//if not defined, then no term text limit, but may be slower
//if defined will be faster (up to 30% in some cases), but will use more memory
#ifndef LUCENE_OPTIMIZE_FOR_MEMORY
#define LUCENE_TERM_TEXT_LENGTH LUCENE_MAX_WORD_LEN
#endif
//
//Size of the CharTokenizer buffersize. Required.
#define LUCENE_IO_BUFFER_SIZE 1024
//
//the minimum amount the segment term enum should grow by. Must be at least 1
#define LUCENE_SEGMENTTERMENUM_GROWSIZE 8
//
//thread locking. Both are Required.
//todo: some of these are runtime options, they should be moved
//into some sort of options file
#define LUCENE_COMMIT_LOCK_TIMEOUT 10000
#define LUCENE_WRITE_LOCK_TIMEOUT 1000
#define LUCENE_DISABLE_LOCKS false
//
////////////////////////////////////////////////////////////////////
#endif
-114
View File
@@ -1,114 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
/*
* this is a monolithic file that can be used to compile clucene using one source file.
* it simplifies some build processes by avoiding static & dynamic compalation pitfalls.
*
* note: when creating a project add either this file, or all the other .cpp files, not both!
*/
#include "CLucene/StdHeader.cpp"
#include "CLucene/analysis/Analyzers.cpp"
#include "CLucene/analysis/AnalysisHeader.cpp"
#include "CLucene/analysis/standard/StandardAnalyzer.cpp"
#include "CLucene/analysis/standard/StandardFilter.cpp"
#include "CLucene/analysis/standard/StandardTokenizer.cpp"
#include "CLucene/config/gunichartables.cpp"
#include "CLucene/config/repl_tcscasecmp.cpp"
#include "CLucene/config/repl_tcslwr.cpp"
#include "CLucene/config/repl_tcstod.cpp"
#include "CLucene/config/repl_lltot.cpp"
#include "CLucene/config/repl_tcstoll.cpp"
#include "CLucene/config/repl_tprintf.cpp"
#include "CLucene/config/threads.cpp"
#include "CLucene/config/utf8.cpp"
#include "CLucene/debug/condition.cpp"
#include "CLucene/debug/error.cpp"
#include "CLucene/debug/mempool.cpp"
#include "CLucene/debug/memtracking.cpp"
#include "CLucene/document/DateField.cpp"
#include "CLucene/document/Document.cpp"
#include "CLucene/document/Field.cpp"
#include "CLucene/index/CompoundFile.cpp"
#include "CLucene/index/DocumentWriter.cpp"
#include "CLucene/index/FieldInfos.cpp"
#include "CLucene/index/FieldsReader.cpp"
#include "CLucene/index/FieldsWriter.cpp"
#include "CLucene/index/IndexWriter.cpp"
#include "CLucene/index/IndexReader.cpp"
#include "CLucene/index/MultiReader.cpp"
#include "CLucene/index/SegmentInfos.cpp"
#include "CLucene/index/SegmentMergeInfo.cpp"
#include "CLucene/index/SegmentMergeQueue.cpp"
#include "CLucene/index/SegmentMerger.cpp"
#include "CLucene/index/SegmentReader.cpp"
#include "CLucene/index/SegmentTermDocs.cpp"
#include "CLucene/index/SegmentTermEnum.cpp"
#include "CLucene/index/SegmentTermPositions.cpp"
#include "CLucene/index/SegmentTermVector.cpp"
#include "CLucene/index/Term.cpp"
#include "CLucene/index/TermInfo.cpp"
#include "CLucene/index/TermInfosReader.cpp"
#include "CLucene/index/TermInfosWriter.cpp"
#include "CLucene/index/TermVectorReader.cpp"
#include "CLucene/index/TermVectorWriter.cpp"
#include "CLucene/queryParser/Lexer.cpp"
#include "CLucene/queryParser/MultiFieldQueryParser.cpp"
#include "CLucene/queryParser/QueryParser.cpp"
#include "CLucene/queryParser/QueryParserBase.cpp"
#include "CLucene/queryParser/QueryToken.cpp"
#include "CLucene/queryParser/TokenList.cpp"
#include "CLucene/search/BooleanQuery.cpp"
#include "CLucene/search/BooleanScorer.cpp"
#include "CLucene/search/CachingWrapperFilter.cpp"
#include "CLucene/search/ChainedFilter.cpp"
#include "CLucene/search/DateFilter.cpp"
#include "CLucene/search/ConjunctionScorer.cpp"
#include "CLucene/search/ExactPhraseScorer.cpp"
#include "CLucene/search/Explanation.cpp"
#include "CLucene/search/FieldCache.cpp"
#include "CLucene/search/FieldCacheImpl.cpp"
#include "CLucene/search/FieldDocSortedHitQueue.cpp"
#include "CLucene/search/FieldSortedHitQueue.cpp"
#include "CLucene/search/FilteredTermEnum.cpp"
#include "CLucene/search/FuzzyQuery.cpp"
#include "CLucene/search/Hits.cpp"
#include "CLucene/search/HitQueue.cpp"
#include "CLucene/search/IndexSearcher.cpp"
#include "CLucene/search/MultiSearcher.cpp"
#include "CLucene/search/MultiTermQuery.cpp"
#include "CLucene/search/PhrasePositions.cpp"
#include "CLucene/search/PhraseQuery.cpp"
#include "CLucene/search/PhraseScorer.cpp"
#include "CLucene/search/PrefixQuery.cpp"
#include "CLucene/search/QueryFilter.cpp"
#include "CLucene/search/RangeQuery.cpp"
#include "CLucene/search/RangeFilter.cpp"
#include "CLucene/search/SearchHeader.cpp"
#include "CLucene/search/Similarity.cpp"
#include "CLucene/search/SloppyPhraseScorer.cpp"
#include "CLucene/search/Sort.cpp"
#include "CLucene/search/TermQuery.cpp"
#include "CLucene/search/TermScorer.cpp"
#include "CLucene/search/WildcardQuery.cpp"
#include "CLucene/search/WildcardTermEnum.cpp"
#include "CLucene/store/FSDirectory.cpp"
#include "CLucene/store/IndexInput.cpp"
#include "CLucene/store/Lock.cpp"
#include "CLucene/store/MMapInput.cpp"
#include "CLucene/store/IndexOutput.cpp"
#include "CLucene/store/RAMDirectory.cpp"
#include "CLucene/store/TransactionalRAMDirectory.cpp"
#include "CLucene/util/BitVector.cpp"
#include "CLucene/util/Equators.cpp"
#include "CLucene/util/FastCharStream.cpp"
#include "CLucene/util/fileinputstream.cpp"
#include "CLucene/util/MD5Digester.cpp"
#include "CLucene/util/Misc.cpp"
#include "CLucene/util/Reader.cpp"
#include "CLucene/util/StringBuffer.cpp"
#include "CLucene/util/StringIntern.cpp"
#include "CLucene/util/dirent.cpp"
@@ -1,50 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _LuceneThreads_h
#define _LuceneThreads_h
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#if defined(_CL_DISABLE_MULTITHREADING)
#define SCOPED_LOCK_MUTEX(theMutex)
#define SCOPED_LOCK_MUTEX_EX(theMutex,mutexname,dummy)
#define DEFINE_MUTEX(x)
#define STATIC_DEFINE_MUTEX(x)
#else
#if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX)
//do nothing
#elif defined(_CL_HAVE_PTHREAD)
#include "CLucene/config/threadPthread.h"
#elif defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) //note that mingw32 could have pthreads, so put this after.
#include "CLucene/config/threadCSection.h"
#else
#error A valid thread library was not found
#endif //mutex types
CL_NS_DEF(util)
class mutexGuard
{
private:
_LUCENE_THREADMUTEX* mrMutex;
mutexGuard(const mutexGuard& clone);
public:
mutexGuard( _LUCENE_THREADMUTEX& rMutex );
~mutexGuard();
};
CL_NS_END
#define SCOPED_LOCK_MUTEX(theMutex) CL_NS(util)::mutexGuard theMutexGuard(theMutex);
#define DEFINE_MUTEX(theMutex) _LUCENE_THREADMUTEX theMutex;
#define STATIC_DEFINE_MUTEX(theMutex) static _LUCENE_THREADMUTEX theMutex;
#endif //_CL_DISABLE_MULTITHREADING
#endif
-11
View File
@@ -1,11 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
stdhdir = $(includedir)/CLucene
libclucene_la_SOURCES += $(lsrcdir)/StdHeader.cpp
stdh_HEADERS = $(lsrcdir)/CLBackwards.h
stdh_HEADERS += $(lsrcdir)/CLConfig.h
stdh_HEADERS += $(lsrcdir)/LuceneThreads.h
stdh_HEADERS += $(lsrcdir)/StdHeader.h
clucene_configdir = $(libdir)/CLucene
clucene_config_DATA = $(top_builddir)/src/CLucene/clucene-config.h
-119
View File
@@ -1,119 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "CLucene/util/Misc.h"
#include "CLucene/search/Sort.h"
#include "CLucene/search/Similarity.h"
#include "CLucene/search/FieldCache.h"
#include "CLucene/search/FieldSortedHitQueue.h"
#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG)
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
CL_NS_USE(util)
TCHAR* _LUCENE_BLANK_STRING=_T("");
char* _LUCENE_BLANK_ASTRING="";
#if defined(_LUCENE_THREADMUTEX_USINGDEFAULT)
#if defined(_LUCENE_PRAGMA_WARNINGS)
#pragma message ("==================Using clunky thread mutex!!!==================")
#else
#warning "==================Using clunky thread mutex!!!=================="
#endif
#endif
#if defined(_ASCII)
#if defined(_LUCENE_PRAGMA_WARNINGS)
#pragma message ("==================Using ascii mode!!!==================")
#else
#warning "==================Using ascii mode!!!=================="
#endif
#endif
#if defined(LUCENE_DISABLE_HASHING)
#if defined(_LUCENE_PRAGMA_WARNINGS)
#pragma message ("==================Hashing not available or is disabled! CLucene may run slower than optimal ==================")
#else
#warning "==================Hashing not available or is disabled! CLucene may run slower than optimal =================="
#endif
#endif
//clears all static memory. do not attempt to do anything else
//in clucene after calling this function
void _lucene_shutdown(){
CL_NS(search)::FieldSortedHitQueue::Comparators.clear();
_CLDELETE(CL_NS(search)::Sort::RELEVANCE);
_CLDELETE(CL_NS(search)::Sort::INDEXORDER);
_CLDELETE(CL_NS(search)::ScoreDocComparator::INDEXORDER);
_CLDELETE(CL_NS(search)::ScoreDocComparator::RELEVANCE);
_CLDELETE(CL_NS(search)::SortField::FIELD_SCORE);
_CLDELETE(CL_NS(search)::SortField::FIELD_DOC);
_CLDELETE(CL_NS(search)::FieldCache::DEFAULT);
_CLLDELETE(CL_NS(search)::Similarity::getDefault());
CL_NS(util)::CLStringIntern::shutdown();
}
void CLDebugBreak(){
//can be used for debug breaking...
#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG)
_CrtDbgBreak();
#else
int i=0; //a line to put breakpoint on
#endif
}
//these are functions that lucene uses which
//are not replacement functions
char* lucenestrdup(const char* v CL_FILELINEPARAM){
size_t len = strlen(v);
char* ret = new char[len+1];
strncpy(ret,v,len+1);
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
#if defined(LUCENE_ENABLE_FILELINEINFO)
CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len);
#else
CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len);
#endif
#endif
return ret;
}
#ifdef _UCS2
wchar_t* lucenewcsdup(const wchar_t* v CL_FILELINEPARAM){
size_t len = _tcslen(v);
wchar_t* ret = new wchar_t[len+1];
_tcsncpy(ret,v,len+1);
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
#if defined(LUCENE_ENABLE_FILELINEINFO)
CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len);
#else
CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len);
#endif
#endif
return ret;
}
#endif //ucs2
//ok, these are the exceptions, but these never
//exist on non-msvc platform, so lets put it here
#ifndef _CL_HAVE_FILELENGTH
int64_t lucene_filelength(int filehandle)
{
struct fileStat info;
if (fileHandleStat(filehandle, &info) == -1)
_CLTHROWA( CL_ERR_IO,"fileStat error" );
return info.st_size;
}
#endif
-459
View File
@@ -1,459 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef lucene_stdheader_h
#define lucene_stdheader_h
#if defined(OVERRIDE_DEFAULT_CLCONFIG)
#include "AltCLConfig.h"
#else
#include "CLucene/CLConfig.h"
#endif
//first inclusion of compiler.h (it will be called again later)
#include "CLucene/config/compiler.h"
extern void _lucene_shutdown();
extern int _lucene_counter_break; //can set a watch on this
#if defined(LUCENE_ENABLE_MEMLEAKTRACKING)
extern bool _lucene_disable_debuglogging; //if LUCENE_ENABLE_CONSTRUCTOR_LOG is on, dont do log if this is true
#endif
////////////////////////////////////////////////////////
// default includes
////////////////////////////////////////////////////////
#ifndef LUCENE_DISABLE_INCLUDES
#include <stdio.h>
#if defined(_CL_STDC_HEADERS)
#include <stdlib.h>
#include <stddef.h>
#else
#if defined(_CL_HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#endif
#if defined(_CL_HAVE_STRING_H)
#if !defined(_CL_STDC_HEADERS) && defined(_CL_HAVE_MEMORY_H)
#include <memory.h>
#endif
#include <string.h>
#elif defined(_CL_HAVE_STRINGS_H)
//note: as a side note, strtok is not thread-safe.. so be careful where you use it!
#error "strtok replacement for BSD has not been implemented"
#include <strings.h>
#if !defined(_CL_HAVE_STRCHR)
#define strchr index
#define strrchr rindex
#endif
#endif
#if defined(_CL_HAVE_UNISTD_H)
#include <unistd.h>
#elif defined(_CL_HAVE_IO_H) && defined(_CL_HAVE_DIRECT_H)
#include <io.h>
#include <direct.h>
#else
#error "Neither unistd.h or (io.h & direct.h) were available"
#endif
#ifndef _CL_DISABLE_NATIVE_EXCEPTIONS
#ifdef _CL_HAVE_STDEXCEPT
#include <stdexcept>
#else
#error "CLucene can't compile with exception handling on because <stdexcept> header is not available"
#endif
#endif
#if defined(_CL_STAT_MACROS_BROKEN)
#error "Haven't implemented STAT_MACROS_BROKEN fix yet"
#elif defined(_CL_HAVE_SYS_STAT_H)
#include <sys/stat.h>
#else
#error "Haven't implemented platforms with no sys/stat.h"
#endif
#if defined(_CL_HAVE_STDARG_H)
#include <stdarg.h>
#else
#error "CLucene can compile, but some extras may not work"
#endif
#if defined(_CL_HAVE_MATH_H)
#include <math.h>
#else
#error "CLucene can't compile without <math.h>"
#endif
#if defined(_CL_HAVE_MAP)
#include <map>
#else
#error "CLucene can't compile without the map header"
#endif
#if defined(_CL_HAVE_LIST)
#include <list>
#else
#error "CLucene can't compile without the list header"
#endif
#if defined(_CL_HAVE_SET)
#include <set>
#else
#error "CLucene can't compile without the set header"
#endif
#if defined(_CL_HAVE_VECTOR)
#include <vector>
#else
#error "CLucene can't compile without the vector header"
#endif
#if !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET)
//hashing is all or nothing!
#include <hash_map>
#include <hash_set>
#elif !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_EXT_HASH_MAP) && defined(_CL_HAVE_EXT_HASH_SET)
#include <ext/hash_map>
#include <ext/hash_set>
#elif !defined(LUCENE_DISABLE_HASHING)
#define LUCENE_DISABLE_HASHING
#endif
#if !defined(LUCENE_DISABLE_HASHING) && !defined(CL_NS_HASHING)
#define CL_NS_HASHING(func) std::func
#endif
#if defined(_CL_HAVE_ALGORITHM)
# include <algorithm>
#else
# error "Can't compile clucene without <algorithm>"
#endif
#if defined(_CL_HAVE_FUNCTIONAL)
# include <functional>
#else
# error "Can't compile clucene without <functional>"
#endif
#if !defined(_CL_HAVE_PRINTF) || !defined(_CL_HAVE_SNPRINTF)
#error "CLucene can't compile without printf or snprintf, replacements have not been implemented"
#endif
#if defined(_UCS2)
#if defined(_CL_HAVE_WCHAR_H)
#include <wchar.h>
#else
//actually the repl_wchar.h replacements header will
//always be included. It replaces some functions
//that are missing in some wchar.h headers.
#endif
#endif
#if defined(_UCS2) && defined(_CL_HAVE_WCTYPE_H)
#include <wctype.h>
#elif defined(_ASCII) && defined(_CL_HAVE_CTYPE_H)
#include <ctype.h>
#undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
#elif defined(_UCS2)
//must be in _UCS2 to use internal char functions
#undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
#define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
#else
#error "Cannot compile in _ASCII without ctype.h"
#endif
//always include replacement, some missing tchar defines
#include "CLucene/config/repl_tchar.h"
#if defined(_CL_HAVE_ERRNO_H)
#include <errno.h>
#else
#error "Haven't implemented platforms with no errno.h"
#endif
#if defined(_CL_HAVE_FCNTL_H)
#include <fcntl.h>
#else
#error "Haven't implemented platforms with no fcntl.h"
#endif
#if defined(_CL_HAVE_WINDOWS_H)
#include <windows.h>
#endif
#endif //LUCENE_DISABLE_INCLUDES
//
////////////////////////////////////////////////////////
//second inclusion of compiler.h
//this gives CompilerXXX.h a chance to include other headers
#include "CLucene/config/compiler.h"
//
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
// Character functions.
// Here we decide whose character functions to use
////////////////////////////////////////////////////////
#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS)
#define stringCaseFold cl_tcscasefold
#undef _istspace
#undef _istdigit
#undef _istalnum
#undef _istalpha
#undef _totlower
#undef _totupper
#define _istalnum cl_isalnum
#define _istalpha cl_isletter
#define _istspace cl_isspace
#define _istdigit cl_isdigit
#define _totlower cl_tolower
#define _totupper cl_toupper
//the methods contained in rep_wctype.h
bool cl_isletter(TCHAR c);
bool cl_isalnum(TCHAR c);
bool cl_isdigit(TCHAR c);
bool cl_isspace (TCHAR c);
TCHAR cl_tolower (TCHAR c);
TCHAR cl_toupper (TCHAR c);
#define stringCaseFold cl_tcscasefold
#define stringCaseFoldCmp cl_tcscasefoldcmp
int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src);
TCHAR* cl_tcscasefold( TCHAR * str, int len=-1 );
//here are some functions to help deal with utf8/ucs2 conversions
//lets let the user decide what mb functions to use... we provide pure utf8 ones no matter what.
/*#undef _mbtowc
#undef _mbstowcs
#undef _wctomb
#undef _wcstombs
#define _mbtowc lucene_mbstowc
#define _mbsstowcs lucene_mbstowcs
#define _wctomb lucene_wcto_mb
#define _wcstombs lucene_wcstombs*/
#else
//we are using native functions
//here are some functions to help deal with utf8/ucs2 conversions
/*#define _mbtowc mbtowc
#define _wctomb wctomb
#define _mbstowcs mbstowcs
#define _wcstombs wcstombs*/
//we are using native character functions
#if defined(_ASCII)
#undef _istspace
#undef _istdigit
#undef _istalnum
#undef _istalpha
#undef _totlower
#undef _totupper
#define _istspace(x) isspace((unsigned char)x)
#define _istdigit(x) isdigit((unsigned char)x)
#define _istalnum(x) isalnum((unsigned char)x)
#define _istalpha(x) isalpha((unsigned char)x)
#define _totlower(x) tolower((unsigned char)x)
#define _totupper(x) toupper((unsigned char)x)
#endif
#endif
//we provide utf8 conversion functions
size_t lucene_utf8towc (wchar_t *ret, const char *s, size_t n);
size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen);
size_t lucene_wctoutf8 (char * ret, const wchar_t str);
size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen);
size_t lucene_utf8charlen(const char *p);
///a blank string...
extern TCHAR* _LUCENE_BLANK_STRING;
#define LUCENE_BLANK_STRING _LUCENE_BLANK_STRING
extern char* _LUCENE_BLANK_ASTRING;
#define LUCENE_BLANK_ASTRING _LUCENE_BLANK_ASTRING
/* Converts a string into a form that is independent of case. The
* result will not correspond to any particular case, but can be
* compared for equality or ordered with the results of calling
* stringCaseFold() on other strings.
*
* If we did not define this elsewhere, then just convert to lower case
*/
#ifndef stringCaseFold
#define stringCaseFold _tcslwr
#endif
/* Compares 2 strings using case folding (if available)
* If we did not define this elsewhere, then just compare
* using normal method
*/
#ifndef stringCaseFoldCmp
#define stringCaseFoldCmp _tcsicmp
#endif
//now that all the character routines are completed, include the
//wchar.h replacements.
#include "CLucene/config/repl_wchar.h" //always include replacements
//a replacement for _tcsdup. This uses new TCHAR[] instead of malloc, so that we can use delete[] to free
#if defined(LUCENE_ENABLE_FILELINEINFO)
#define CL_FILELINE ,__FILE__,__LINE__
#define CL_FILELINEREF ,file,line ///<for passing the reference along to another function
#define CL_FILELINEREF2 ,file,line ///<for passing the reference along to another function
#define CL_FILELINEPARAM ,char* file,int line
#else
#define CL_FILELINE
#define CL_FILELINEREF
#define CL_FILELINEREF2 ,NULL,-1
#define CL_FILELINEPARAM
#endif
char* lucenestrdup(const char* v CL_FILELINEPARAM);
#if defined(_UCS2)
wchar_t* lucenewcsdup(const wchar_t* v CL_FILELINEPARAM);
#define stringDuplicate(x) lucenewcsdup(x CL_FILELINE) //don't change this... uses [] instead of malloc
#else
#define stringDuplicate(x) lucenestrdup(x CL_FILELINE) //don't change this... uses [] instead of malloc
#endif
#define STRCPY_AtoA(target,src,len) strncpy(target,src,len)
#define STRDUP_AtoA(x) lucenestrdup(x CL_FILELINE)
#if defined(_UCS2)
#define STRDUP_WtoW(x) lucenewcsdup(x CL_FILELINE)
#define STRDUP_TtoT STRDUP_WtoW
#define STRDUP_WtoT STRDUP_WtoW
#define STRDUP_TtoW STRDUP_WtoW
#define STRDUP_AtoW(x) CL_NS(util)::Misc::_charToWide(x CL_FILELINE)
#define STRDUP_AtoT STRDUP_AtoW
#define STRDUP_WtoA(x) CL_NS(util)::Misc::_wideToChar(x CL_FILELINE)
#define STRDUP_TtoA STRDUP_WtoA
#define STRCPY_WtoW(target,src,len) _tcsncpy(target,src,len)
#define STRCPY_TtoW STRCPY_WtoW
#define STRCPY_WtoT STRCPY_WtoW
#define STRCPY_TtoT STRCPY_WtoW
#define STRCPY_AtoW(target,src,len) CL_NS(util)::Misc::_cpycharToWide(src,target,len)
#define STRCPY_AtoT STRCPY_AtoW
#define STRCPY_WtoA(target,src,len) CL_NS(util)::Misc::_cpywideToChar(src,target,len)
#define STRCPY_TtoA STRCPY_WtoA
#else
#define STRDUP_AtoT STRDUP_AtoA
#define STRDUP_TtoA STRDUP_AtoA
#define STRDUP_TtoT STRDUP_AtoA
#define STRDUP_WtoT(x) xxxxxxxxxxxxxxx //not possible
#define STRCPY_WtoT(target,src,len) xxxxxxxxxxxxxxx //not possible
#define STRCPY_AtoT STRCPY_AtoA
#define STRCPY_TtoA STRCPY_AtoA
#define STRCPY_TtoT STRCPY_AtoA
#endif
//
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
//namespace helper
////////////////////////////////////////////////////////
#if defined(_LUCENE_DONTIMPLEMENT_NS_MACROS)
#elif !defined(DISABLE_NAMESPACE)
#define CL_NS_DEF(sub) namespace lucene{ namespace sub{
#define CL_NS_DEF2(sub,sub2) namespace lucene{ namespace sub{ namespace sub2 {
#define CL_NS_END }}
#define CL_NS_END2 }}}
#define CL_NS_USE(sub) using namespace lucene::sub;
#define CL_NS_USE2(sub,sub2) using namespace lucene::sub::sub2;
#define CL_NS(sub) lucene::sub
#define CL_NS2(sub,sub2) lucene::sub::sub2
#else
#define CL_NS_DEF(sub)
#define CL_NS_DEF2(sub, sub2)
#define CL_NS_END
#define CL_NS_END2
#define CL_NS_USE(sub)
#define CL_NS_USE2(sub,sub2)
#define CL_NS(sub)
#define CL_NS2(sub,sub2)
#endif
#if defined(LUCENE_NO_STDC_NAMESPACE)
//todo: haven't actually tested this on a non-stdc compliant compiler
#define CL_NS_STD(func) ::func
#else
#define CL_NS_STD(func) std::func
#endif
//
////////////////////////////////////////////////////////
//
void CLDebugBreak(); //define a debugbreak function
////////////////////////////////////////////////////////////////
// These are defines and functions used throughout clucene
////////////////////////////////////////////////////////////////
#undef _T //remove any previously defined _T - required for ppc os
#if defined(_UCS2)
#define _T(x) L ## x
#else
#define _T(x) x
#endif
//third inclusion of compiler.h
//this gives CompilerXXX.h a chance to fix any of the
//default settings
#include "CLucene/config/compiler.h"
//use std namespace
#ifndef LUCENE_NO_STDC_NAMESPACE
using namespace std;
#endif
////////////////////////////////////////////////////////
//misc shortcut defines
////////////////////////////////////////////////////////
//include the headers that we need practically everywhere
#include "CLucene/debug/error.h" //all delete/creation/mem debugging code
#include "CLucene/debug/mem.h" //all delete/creation/mem debugging code
#include "CLucene/debug/condition.h" //conditional debugging (like assert)
#include "LuceneThreads.h" //lucene threading support
#include "CLucene/util/Misc.h"
#include "CLucene/util/Equators.h"
#include "CLucene/util/VoidList.h"
#include "CLucene/util/VoidMap.h"
CL_NS_DEF(util)
typedef CL_NS(util)::CLVector<TCHAR*> StringArray;
typedef CL_NS(util)::CLVector<TCHAR*, CL_NS(util)::Deletor::tcArray > StringArrayWithDeletor;
typedef CL_NS(util)::CLVector<const TCHAR*> StringArrayConst;
typedef CL_NS(util)::CLVector<const TCHAR*, CL_NS(util)::Deletor::tcArray > StringArrayConstWithDeletor;
typedef CL_NS(util)::CLVector<char*> AStringArray;
typedef CL_NS(util)::CLVector<char*, CL_NS(util)::Deletor::acArray > AStringArrayWithDeletor;
typedef CL_NS(util)::CLVector<const char*> AStringArrayConst;
typedef CL_NS(util)::CLVector<const char*, CL_NS(util)::Deletor::acArray > AStringArrayConstWithDeletor;
CL_NS_END
//
////////////////////////////////////////////////////////
#endif // STDHEADER_H
@@ -1,176 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "AnalysisHeader.h"
CL_NS_USE(util)
CL_NS_DEF(analysis)
const TCHAR* Token::defaultType=_T("word");
Token::Token():
_startOffset (0),
_endOffset (0),
_type ( defaultType ),
positionIncrement (1)
{
termTextLen = 0;
#ifndef LUCENE_TOKEN_WORD_LENGTH
_termText = NULL;
bufferTextLen = 0;
#else
_termText[0] = 0; //make sure null terminated
bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1;
#endif
}
Token::~Token(){
#ifndef LUCENE_TOKEN_WORD_LENGTH
_CLDELETE_CARRAY(_termText);
#endif
}
Token::Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ):
_startOffset (start),
_endOffset (end),
_type ( typ ),
positionIncrement (1)
{
termTextLen = 0;
#ifndef LUCENE_TOKEN_WORD_LENGTH
_termText = NULL;
bufferTextLen = 0;
#else
_termText[0] = 0; //make sure null terminated
bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1;
#endif
setText(text);
}
void Token::set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ){
_startOffset = start;
_endOffset = end;
_type = typ;
positionIncrement = 1;
setText(text);
}
void Token::setText(const TCHAR* text){
int32_t oldlen = termTextLen;
termTextLen = _tcslen(text);
#ifndef LUCENE_TOKEN_WORD_LENGTH
if ( termTextLen > oldlen || _termText == NULL ){
_CLDELETE_CARRAY(_termText);
_termText = _CL_NEWARRAY(TCHAR,termTextLen+1);
bufferTextLen = termTextLen+1;
}
_tcsncpy(_termText,text,termTextLen+1);
#else
if ( termTextLen > LUCENE_TOKEN_WORD_LENGTH ){
//in the case where this occurs, we will leave the endOffset as it is
//since the actual word still occupies that space.
termTextLen=LUCENE_TOKEN_WORD_LENGTH;
}
_tcsncpy(_termText,text,termTextLen+1);
#endif
_termText[termTextLen] = 0; //make sure null terminated
}
void Token::growBuffer(size_t size){
if(bufferTextLen>size)
return;
#ifndef LUCENE_TOKEN_WORD_LENGTH
_CLDELETE_CARRAY(_termText);
termTextLen=-1;
bufferTextLen = size+1;
_termText = _CL_NEWARRAY(TCHAR,bufferTextLen);
#else
_CLTHROWA(CL_ERR_TokenMgr,"Couldn't grow Token buffer");
#endif
}
void Token::setPositionIncrement(int32_t posIncr) {
if (posIncr < 0) {
_CLTHROWA(CL_ERR_IllegalArgument,"positionIncrement must be >= 0");
}
positionIncrement = posIncr;
}
int32_t Token::getPositionIncrement() { return positionIncrement; }
// Returns the Token's term text.
const TCHAR* Token::termText() {
return (const TCHAR*) _termText;
}
size_t Token::termTextLength() {
if ( termTextLen == -1 ) //it was invalidated by growBuffer
termTextLen = _tcslen(_termText);
return termTextLen;
}
void Token::resetTermTextLen(){
termTextLen=-1;
}
bool Token::OrderCompare::operator()( Token* t1, Token* t2 ) const{
if(t1->startOffset()>t2->startOffset())
return false;
if(t1->startOffset()<t2->startOffset())
return true;
return true;
}
Token* TokenStream::next(){
Token* t = _CLNEW Token;
if ( !next(t) )
_CLDELETE(t);
return t;
}
TokenFilter::TokenFilter(TokenStream* in, bool deleteTS):
input(in),
deleteTokenStream(deleteTS)
{
}
TokenFilter::~TokenFilter(){
close();
}
// Close the input TokenStream.
void TokenFilter::close() {
if ( input != NULL ){
input->close();
if ( deleteTokenStream )
_CLDELETE( input );
}
input = NULL;
}
Tokenizer::Tokenizer() {
input = NULL;
}
Tokenizer::Tokenizer(CL_NS(util)::Reader* _input):
input(_input)
{
}
void Tokenizer::close(){
if (input != NULL) {
// ? delete input;
input = NULL;
}
}
Tokenizer::~Tokenizer(){
close();
}
CL_NS_END
@@ -1,181 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_AnalysisHeader_
#define _lucene_analysis_AnalysisHeader_
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "CLucene/util/Reader.h"
#include "CLucene/debug/pool.h"
CL_NS_DEF(analysis)
LUCENE_MP_DEFINE(Token)
/** A Token is an occurence of a term from the text of a field. It consists of
a term's text, the start and end offset of the term in the text of the field,
and a type string.
The start and end offsets permit applications to re-associate a token with
its source text, e.g., to display highlighted query terms in a document
browser, or to show matching text fragments in a KWIC (KeyWord In Context)
display, etc.
The type is an interned string, assigned by a lexical analyzer
(a.k.a. tokenizer), naming the lexical or syntactic class that the token
belongs to. For example an end of sentence marker token might be implemented
with type "eos". The default token type is "word". */
class Token:LUCENE_POOLEDBASE(Token){
private:
int32_t _startOffset; // start in source text
int32_t _endOffset; // end in source text
const TCHAR* _type; // lexical type
int32_t positionIncrement;
int32_t termTextLen;
size_t bufferTextLen;
static const TCHAR* defaultType;
public:
#ifndef LUCENE_HIDE_INTERNAL
#ifndef LUCENE_TOKEN_WORD_LENGTH
TCHAR* _termText; // the text of the term
#else
TCHAR _termText[LUCENE_TOKEN_WORD_LENGTH+1]; // the text of the term
#endif
#endif
Token();
~Token();
// Constructs a Token with the given text, start and end offsets, & type.
Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType);
void set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType);
size_t bufferLength(){ return bufferTextLen; }
void growBuffer(size_t size);
/* Set the position increment. This determines the position of this
* token relative to the previous Token in a TokenStream, used in
* phrase searching.
*
* The default value is 1.
*
* Some common uses for this are:
*
* - Set it to zero to put multiple terms in the same position. This is
* useful if, e.g., a word has multiple stems. Searches for phrases
* including either stem will match. In this case, all but the first stem's
* increment should be set to zero: the increment of the first instance
* should be one. Repeating a token with an increment of zero can also be
* used to boost the scores of matches on that token.
*
* - Set it to values greater than one to inhibit exact phrase matches.
* If, for example, one does not want phrases to match across removed stop
* words, then one could build a stop word filter that removes stop words and
* also sets the increment to the number of stop words removed before each
* non-stop word. Then exact phrase queries will only match when the terms
* occur with no intervening stop words.
*/
void setPositionIncrement(int32_t posIncr);
int32_t getPositionIncrement();
const TCHAR* termText();
size_t termTextLength();
void resetTermTextLen();
void setText(const TCHAR* txt);
// Returns this Token's starting offset, the position of the first character
// corresponding to this token in the source text.
//
// Note that the difference between endOffset() and startOffset() may not be
// equal to termText.length(), as the term text may have been altered by a
// stemmer or some other filter.
int32_t startOffset() const { return _startOffset; }
void setStartOffset(int32_t val){ _startOffset =val; }
// Returns this Token's ending offset, one greater than the position of the
// last character corresponding to this token in the source text.
int32_t endOffset() const { return _endOffset; }
void setEndOffset(int32_t val){ _endOffset =val; }
// Returns this Token's lexical type. Defaults to "word".
const TCHAR* type() const { return _type; } ///<returns reference
void setType(const TCHAR* val) { _type = val; } ///<returns reference
///Compares the Token for their order
class OrderCompare:LUCENE_BASE, public CL_NS(util)::Compare::_base //<Token*>
{
public:
bool operator()( Token* t1, Token* t2 ) const;
};
};
class TokenStream:LUCENE_BASE {
public:
/**
* Returns the next token in the stream, or null at EOS.
*/
virtual bool next(Token* token) = 0;
// Releases resources associated with this stream.
virtual void close() = 0;
virtual ~TokenStream(){
}
/* This is for backwards compatibility only. You should pass the token you want to fill
* to next(), this will save a lot of object construction and destructions.
* @deprecated Kept only to avoid breaking existing code.
*/
Token* next();
};
class Analyzer:LUCENE_BASE{
public:
// Creates a TokenStream which tokenizes all the text in the provided
// Reader. Default implementation forwards to tokenStream(Reader) for
// compatibility with older version. Override to allow Analyzer to choose
// strategy based on document and/or field. Must be able to handle null
// field name for backward compatibility.
virtual TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader)=0;
virtual ~Analyzer(){
}
};
class Tokenizer:public TokenStream {
protected:
// The text source for this Tokenizer.
CL_NS(util)::Reader* input;
public:
Tokenizer();
/** Construct a token stream processing the given input. */
Tokenizer(CL_NS(util)::Reader* _input);
// By default, closes the input Reader.
virtual void close();
virtual ~Tokenizer();
};
class TokenFilter:public TokenStream {
protected:
// The source of tokens for this filter.
TokenStream* input;
bool deleteTokenStream;
TokenFilter(TokenStream* in, bool deleteTS=false);
virtual ~TokenFilter();
public:
// Close the input TokenStream.
void close();
};
CL_NS_END
#endif
@@ -1,310 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "Analyzers.h"
#include "CLucene/util/StringBuffer.h"
CL_NS_USE(util)
CL_NS_DEF(analysis)
CharTokenizer::CharTokenizer(Reader* in) :
//input(in), ; input is in tokenizer base class (bug fix thanks to Andy Osipienko)
offset(0),
bufferIndex(0),
dataLen(0)
{
input = in;
}
TCHAR CharTokenizer::normalize(const TCHAR c) const
{
return c;
}
bool CharTokenizer::next(Token* token){
int32_t length = 0;
int32_t start = offset;
while (true) {
TCHAR c;
offset++;
if (bufferIndex >= dataLen) {
dataLen = input->read(ioBuffer, LUCENE_IO_BUFFER_SIZE);
if (dataLen == -1)
dataLen = 0;
bufferIndex = 0;
}
if (dataLen <= 0 ) {
if (length > 0)
break;
else
return false;
}else
c = ioBuffer[bufferIndex++];
if (isTokenChar(c)) { // if it's a token TCHAR
if (length == 0) // start of token
start = offset-1;
buffer[length++] = normalize(c); // buffer it, normalized
if (length == LUCENE_MAX_WORD_LEN) // buffer overflow!
break;
} else if (length > 0) // at non-Letter w/ chars
break; // return 'em
}
buffer[length]=0;
token->set( buffer, start, start+length);
return true;
}
bool LetterTokenizer::isTokenChar(const TCHAR c) const {
return _istalpha(c)!=0;
}
TCHAR LowerCaseTokenizer::normalize(const TCHAR chr) const {
return _totlower(chr);
}
bool WhitespaceTokenizer::isTokenChar(const TCHAR c) const{
return _istspace(c)==0; //(return true if NOT a space)
}
TokenStream* WhitespaceAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) {
return _CLNEW WhitespaceTokenizer(reader);
}
TokenStream* SimpleAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) {
return _CLNEW LowerCaseTokenizer(reader);
}
bool LowerCaseFilter::next(Token* t){
if (!input->next(t))
return false;
stringCaseFold( t->_termText );
return true;
}
StopFilter::StopFilter(TokenStream* in, bool deleteTokenStream, TCHAR** stopWords):
TokenFilter(in, deleteTokenStream),
table(_CLNEW CLSetList<TCHAR*>(false))
{
fillStopTable( table,stopWords );
}
void StopFilter::fillStopTable(CLSetList<TCHAR*>* stopTable,
TCHAR** stopWords) {
for (int32_t i = 0; stopWords[i]!=NULL; i++)
stopTable->insert(stopWords[i]);
}
bool StopFilter::next(Token* token) {
// return the first non-stop word found
for (; input->next(token); ){
if (table->find(token->_termText)==table->end()){
return true;
}
}
// reached EOS -- return nothing
return false;
}
StopAnalyzer::StopAnalyzer():stopTable(false)
{
StopFilter::fillStopTable(&stopTable,ENGLISH_STOP_WORDS);
}
StopAnalyzer::~StopAnalyzer()
{
}
StopAnalyzer::StopAnalyzer( TCHAR** stopWords) {
StopFilter::fillStopTable(&stopTable,stopWords);
}
TokenStream* StopAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) {
return _CLNEW StopFilter(_CLNEW LowerCaseTokenizer(reader),true, &stopTable);
}
TCHAR* StopAnalyzer::ENGLISH_STOP_WORDS[] =
{
_T("a"), _T("an"), _T("and"), _T("are"), _T("as"), _T("at"), _T("be"), _T("but"), _T("by"),
_T("for"), _T("if"), _T("in"), _T("into"), _T("is"), _T("it"),
_T("no"), _T("not"), _T("of"), _T("on"), _T("or"), _T("s"), _T("such"),
_T("t"), _T("that"), _T("the"), _T("their"), _T("then"), _T("there"), _T("these"),
_T("they"), _T("this"), _T("to"), _T("was"), _T("will"), _T("with"), NULL
};
PerFieldAnalyzerWrapper::PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer):
analyzerMap(true,true)
{
this->defaultAnalyzer = defaultAnalyzer;
}
PerFieldAnalyzerWrapper::~PerFieldAnalyzerWrapper(){
analyzerMap.clear();
_CLDELETE(defaultAnalyzer);
}
void PerFieldAnalyzerWrapper::addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer) {
analyzerMap.put(STRDUP_TtoT(fieldName), analyzer);
}
TokenStream* PerFieldAnalyzerWrapper::tokenStream(const TCHAR* fieldName, Reader* reader) {
Analyzer* analyzer = analyzerMap.get(fieldName);
if (analyzer == NULL) {
analyzer = defaultAnalyzer;
}
return analyzer->tokenStream(fieldName, reader);
}
bool ISOLatin1AccentFilter::next(Token* token){
if ( input->next(token) ){
StringBuffer output;
int32_t l = token->termTextLength();
const TCHAR* chars = token->termText();
for (int32_t i = 0; i < l; i++) {
#ifdef _UCS2
TCHAR c = chars[i];
#else
unsigned char c = chars[i];
#endif
switch (c) {
case 0xC0 : // À
case 0xC1 : // Á
case 0xC2 : // Â
case 0xC3 : // Ã
case 0xC4 : // Ä
case 0xC5 : // Å
output.appendChar('A');
break;
case 0xC6 : // Æ
output.append(_T("AE"));
break;
case 0xC7 : // Ç
output.appendChar('C');
break;
case 0xC8 : // È
case 0xC9 : // É
case 0xCA : // Ê
case 0xCB : // Ë
output.appendChar('E');
break;
case 0xCC : // Ì
case 0xCD : // Í
case 0xCE : // Î
case 0xCF : // Ï
output.appendChar('I');
break;
case 0xD0 : // Ð
output.appendChar('D');
break;
case 0xD1 : // Ñ
output.appendChar('N');
break;
case 0xD2 : // Ò
case 0xD3 : // Ó
case 0xD4 : // Ô
case 0xD5 : // Õ
case 0xD6 : // Ö
case 0xD8 : // Ø
output.appendChar('O');
break;
case 0xDE : // Þ
output.append(_T("TH"));
break;
case 0xD9 : // Ù
case 0xDA : // Ú
case 0xDB : // Û
case 0xDC : // Ü
output.appendChar('U');
break;
case 0xDD : // Ý
output.appendChar('Y');
break;
case 0xE0 : // à
case 0xE1 : // á
case 0xE2 : // â
case 0xE3 : // ã
case 0xE4 : // ä
case 0xE5 : // å
output.appendChar('a');
break;
case 0xE6 : // æ
output.append(_T("ae"));
break;
case 0xE7 : // ç
output.appendChar('c');
break;
case 0xE8 : // è
case 0xE9 : // é
case 0xEA : // ê
case 0xEB : // ë
output.appendChar('e');
break;
case 0xEC : // ì
case 0xED : // í
case 0xEE : // î
case 0xEF : // ï
output.appendChar('i');
break;
case 0xF0 : // ð
output.appendChar('d');
break;
case 0xF1 : // ñ
output.appendChar('n');
break;
case 0xF2 : // ò
case 0xF3 : // ó
case 0xF4 : // ô
case 0xF5 : // õ
case 0xF6 : // ö
case 0xF8 : // ø
output.appendChar('o');
break;
case 0xDF : // ß
output.append(_T("ss"));
break;
case 0xFE : // þ
output.append(_T("th"));
break;
case 0xF9 : // ù
case 0xFA : // ú
case 0xFB : // û
case 0xFC : // ü
output.appendChar('u');
break;
case 0xFD : // ý
case 0xFF : // ÿ
output.appendChar('y');
break;
#ifdef _UCS2
case 0x152 : // Œ
output.append(_T("OE"));
break;
case 0x153 : // œ
output.append(_T("oe"));
break;
case 0x178 : // Ÿ
output.appendChar('Y');
break;
#endif
default :
output.appendChar(chars[i]);
break;
}
}
token->setText(output.getBuffer());
return true;
}
return false;
}
CL_NS_END
@@ -1,261 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_Analyzers_
#define _lucene_analysis_Analyzers_
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "CLucene/util/Reader.h"
#include "AnalysisHeader.h"
#include "CLucene/util/Misc.h"
CL_NS_DEF(analysis)
class CharTokenizer:public Tokenizer {
private:
int32_t offset, bufferIndex, dataLen;
TCHAR buffer[LUCENE_MAX_WORD_LEN+1];
const TCHAR* ioBuffer;
protected:
// Returns true iff a character should be included in a token. This
// tokenizer generates as tokens adjacent sequences of characters which
// satisfy this predicate. Characters for which this is false are used to
// define token boundaries and are not included in tokens.
virtual bool isTokenChar(const TCHAR c) const = 0;
// Called on each token character to normalize it before it is added to the
// token. The default implementation does nothing. Subclasses may use this
// to, e.g., lowercase tokens.
virtual TCHAR normalize(const TCHAR c) const;
public:
CharTokenizer(CL_NS(util)::Reader* in);
virtual ~CharTokenizer(){
}
// Returns the next token in the stream, or null at EOS.
// *** This is not a pointer. Use of it must deleted.
bool next(Token* token);
};
class LetterTokenizer:public CharTokenizer {
public:
// Construct a new LetterTokenizer.
LetterTokenizer(CL_NS(util)::Reader* in):
CharTokenizer(in) {}
~LetterTokenizer(){}
protected:
// Collects only characters which satisfy
// {@link Character#isLetter(TCHAR)}.
bool isTokenChar(const TCHAR c) const;
};
// LowerCaseTokenizer performs the function of LetterTokenizer
// and LowerCaseFilter together. It divides text at non-letters and converts
// them to lower case. While it is functionally equivalent to the combination
// of LetterTokenizer and LowerCaseFilter, there is a performance advantage
// to doing the two tasks at once, hence this (redundant) implementation.
// <P>
// Note: this does a decent job for most European languages, but does a terrible
// job for some Asian languages, where words are not separated by spaces.
class LowerCaseTokenizer:public LetterTokenizer {
public:
// Construct a new LowerCaseTokenizer.
LowerCaseTokenizer(CL_NS(util)::Reader* in):
LetterTokenizer(in) {}
~LowerCaseTokenizer(){}
protected:
// Collects only characters which satisfy
// {@link Character#isLetter(TCHAR)}.
TCHAR normalize(const TCHAR chr) const;
};
class WhitespaceTokenizer: public CharTokenizer {
public:
// Construct a new WhitespaceTokenizer.
WhitespaceTokenizer(CL_NS(util)::Reader* in):CharTokenizer(in) {}
~WhitespaceTokenizer(){}
protected:
// Collects only characters which do not satisfy
// {@link Character#isWhitespace(TCHAR)}.
bool isTokenChar(const TCHAR c) const;
};
// An Analyzer that uses WhitespaceTokenizer.
class WhitespaceAnalyzer: public Analyzer {
public:
TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
~WhitespaceAnalyzer(){}
};
class SimpleAnalyzer: public Analyzer {
public:
TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
~SimpleAnalyzer(){}
};
/**
* Normalizes token text to lower case.
*
* @version $Id: Analyzers.h 2187 2006-06-11 11:39:16Z ustramooner $
*/
class LowerCaseFilter: public TokenFilter {
public:
LowerCaseFilter(TokenStream* in, bool deleteTokenStream):TokenFilter(in,deleteTokenStream) {}
~LowerCaseFilter(){}
bool next(Token* token);
};
// Removes stop words from a token stream.
class StopFilter: public TokenFilter {
private:
//bvk: i found this to work faster with a non-hash table. the number of items
//in the stop table is not like to make it worth having hashing.
CL_NS(util)::CLSetList<TCHAR*>* table;
public:
// Constructs a filter which removes words from the input
// TokenStream that are named in the array of words.
StopFilter(TokenStream* in, bool deleteTokenStream, TCHAR* stopWords[]);
~StopFilter(){}
// Constructs a filter which removes words from the input
// TokenStream that are named in the Hashtable.
StopFilter(TokenStream* in, bool deleteTokenStream, CL_NS(util)::CLSetList<TCHAR*>* stopTable):
TokenFilter(in, deleteTokenStream),
table(stopTable)
{}
/**
* Builds a Hashtable from an array of stop words, appropriate for passing
* into the StopFilter constructor. This permits this table construction to
* be cached once when an Analyzer is constructed.
* Note: the stopWords list must be a static list because the strings are not copied
*
* @swig stopWords
*/
static void fillStopTable(CL_NS(util)::CLSetList<TCHAR*>* stopTable,
TCHAR** stopWords);
/**
* Returns the next input Token whose termText() is not a stop word.
*
* @swig token byref
*/
bool next(Token* token);
};
//An array containing some common English words that are usually not
//useful for searching.
// Filters LetterTokenizer with LowerCaseFilter and StopFilter.
class StopAnalyzer: public Analyzer {
CL_NS(util)::CLSetList<TCHAR*> stopTable;
public:
// Builds an analyzer which removes words in ENGLISH_STOP_WORDS.
StopAnalyzer();
~StopAnalyzer();
// Builds an analyzer which removes words in the provided array.
StopAnalyzer( TCHAR** stopWords );
// Filters LowerCaseTokenizer with StopFilter.
TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
static TCHAR* ENGLISH_STOP_WORDS[];
};
/**
* This analyzer is used to facilitate scenarios where different
* fields require different analysis techniques. Use {@link #addAnalyzer}
* to add a non-default analyzer on a field name basis.
*
* <p>Example usage:
*
* <pre>
* PerFieldAnalyzerWrapper aWrapper =
* new PerFieldAnalyzerWrapper(new StandardAnalyzer());
* aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
* aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
* </pre>
*
* <p>In this example, StandardAnalyzer will be used for all fields except "firstname"
* and "lastname", for which KeywordAnalyzer will be used.
*
* <p>A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing
* and query parsing.
*/
class PerFieldAnalyzerWrapper : public Analyzer {
private:
Analyzer* defaultAnalyzer;
CL_NS(util)::CLHashMap<const TCHAR*, Analyzer*, CL_NS(util)::Compare::TChar,
CL_NS(util)::Deletor::tcArray,CL_NS(util)::Deletor::Void<Analyzer> > analyzerMap;
public:
/**
* Constructs with default analyzer.
*
* @param defaultAnalyzer Any fields not specifically
* defined to use a different analyzer will use the one provided here.
*/
PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer);
~PerFieldAnalyzerWrapper();
/**
* Defines an analyzer to use for the specified field.
*
* @param fieldName field name requiring a non-default analyzer
* @param analyzer non-default analyzer to use for field
*/
void addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer);
TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
};
/**
* A filter that replaces accented characters in the ISO Latin 1 character set
* (ISO-8859-1) by their unaccented equivalent. The case will not be altered.
* <p>
* For instance, '&agrave;' will be replaced by 'a'.
* <p>
*/
class ISOLatin1AccentFilter: public TokenFilter {
public:
ISOLatin1AccentFilter(TokenStream* input, bool deleteTs):
TokenFilter(input,deleteTs)
{
}
/**
* To replace accented characters in a String by unaccented equivalents.
*/
bool next(Token* token);
};
CL_NS_END
#endif
@@ -1,8 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
analyzersdir = $(lsrcdir)/analysis
analyzershdir = $(includedir)/CLucene/analysis
libclucene_la_SOURCES += $(analyzersdir)/Analyzers.cpp
libclucene_la_SOURCES += $(analyzersdir)/AnalysisHeader.cpp
analyzersh_HEADERS = $(analyzersdir)/*.h
@@ -1,9 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
stdandir = $(lsrcdir)/analysis/standard
stdanhdir = $(includedir)/CLucene/analysis/standard
libclucene_la_SOURCES += $(stdandir)/StandardAnalyzer.cpp
libclucene_la_SOURCES += $(stdandir)/StandardFilter.cpp
libclucene_la_SOURCES += $(stdandir)/StandardTokenizer.cpp
stdanh_HEADERS = $(stdandir)/*.h
@@ -1,47 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "StandardAnalyzer.h"
#include "CLucene/util/VoidMap.h"
#include "CLucene/util/Reader.h"
#include "CLucene/analysis/AnalysisHeader.h"
#include "CLucene/analysis/Analyzers.h"
#include "StandardFilter.h"
#include "StandardTokenizer.h"
CL_NS_USE(util)
CL_NS_USE(analysis)
CL_NS_DEF2(analysis,standard)
StandardAnalyzer::StandardAnalyzer():
stopSet(false)
{
StopFilter::fillStopTable( &stopSet,CL_NS(analysis)::StopAnalyzer::ENGLISH_STOP_WORDS);
}
StandardAnalyzer::StandardAnalyzer( TCHAR** stopWords):
stopSet(false)
{
StopFilter::fillStopTable( &stopSet,stopWords );
}
StandardAnalyzer::~StandardAnalyzer(){
}
TokenStream* StandardAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader)
{
TokenStream* ret = _CLNEW StandardTokenizer(reader);
ret = _CLNEW StandardFilter(ret,true);
ret = _CLNEW LowerCaseFilter(ret,true);
ret = _CLNEW StopFilter(ret,true, &stopSet);
//ret = _CLNEW PorterStemmerFilter(ret,true); //todo: can we add this in somewhere?
return ret;
}
CL_NS_END2
@@ -1,47 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_standard_StandardAnalyzer
#define _lucene_analysis_standard_StandardAnalyzer
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "CLucene/util/VoidMap.h"
#include "CLucene/util/Reader.h"
#include "CLucene/analysis/AnalysisHeader.h"
#include "CLucene/analysis/Analyzers.h"
#include "StandardFilter.h"
#include "StandardTokenizer.h"
CL_NS_DEF2(analysis,standard)
//Represents a standard analyzer.
class StandardAnalyzer : public Analyzer
{
private:
CL_NS(util)::CLSetList<TCHAR*> stopSet;
public:
// <summary> Builds an analyzer. </summary>
StandardAnalyzer();
//<summary> Builds an analyzer with the given stop words. </summary>
StandardAnalyzer( TCHAR** stopWords);
~StandardAnalyzer();
// <summary>
// Constructs a StandardTokenizer filtered by a
// StandardFilter, a LowerCaseFilter and a StopFilter.
// </summary>
TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader)
;
};
CL_NS_END2
#endif
@@ -1,58 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "StandardFilter.h"
#include "../AnalysisHeader.h"
#include "../Analyzers.h"
#include "StandardTokenizerConstants.h"
#include "CLucene/util/StringBuffer.h"
CL_NS_USE(analysis)
CL_NS_USE(util)
CL_NS_DEF2(analysis,standard)
StandardFilter::StandardFilter(TokenStream* in, bool deleteTokenStream):
TokenFilter(in, deleteTokenStream)
{
}
StandardFilter::~StandardFilter(){
}
bool StandardFilter::next(Token* t) {
if (!input->next(t))
return false;
TCHAR* text = t->_termText;
const int32_t textLength = t->termTextLength();
const TCHAR* type = t->type();
if ( type == tokenImage[APOSTROPHE] && //we can compare the type directy since the type should always come from the tokenImage
( textLength >= 2 && _tcsicmp(text+textLength-2, _T("'s"))==0 ) )
{
// remove 's
text[textLength-2]=0;
t->resetTermTextLen();
return true;
} else if ( type == tokenImage[ACRONYM] ) { // remove dots
int32_t j = 0;
for ( int32_t i=0;i<textLength;i++ ){
if ( text[i] != '.' )
text[j++]=text[i];
}
text[j]=0;
return true;
} else {
return true;
}
}
CL_NS_END2
@@ -1,37 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_standard_StandardFilter
#define _lucene_analysis_standard_StandardFilter
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "../AnalysisHeader.h"
#include "../Analyzers.h"
#include "StandardTokenizerConstants.h"
#include "CLucene/util/StringBuffer.h"
CL_NS_DEF2(analysis,standard)
// Normalizes tokens extracted with {@link StandardTokenizer}.
class StandardFilter: public TokenFilter{
public:
// Construct filtering <i>in</i>.
StandardFilter(TokenStream* in, bool deleteTokenStream);
~StandardFilter();
/** Returns the next token in the stream, or NULL at EOS.
* <p>Removes <tt>'s</tt> from the end of words.
* <p>Removes dots from acronyms.
*/
bool next(Token* token);
};
CL_NS_END2
#endif
@@ -1,415 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "StandardTokenizer.h"
CL_NS_USE(analysis)
CL_NS_USE(util)
CL_NS_DEF2(analysis,standard)
/* A bunch of shortcut macros, many of which make assumptions about variable
** names. These macros enhance readability, not just convenience! */
#define EOS (ch==-1 || rd->Eos())
#define SPACE (_istspace((TCHAR)ch) != 0)
#define ALPHA (_istalpha((TCHAR)ch) != 0)
#define ALNUM (_istalnum(ch) != 0)
#define DIGIT (_istdigit(ch) != 0)
#define UNDERSCORE (ch == '_')
#define DASH (ch == '-')
#define NEGATIVE_SIGN_ DASH
#define POSITIVE_SIGN_ (ch == '+')
#define SIGN (NEGATIVE_SIGN_ || POSITIVE_SIGN_)
#define DOT (ch == '.')
#define DECIMAL DOT
//freebsd seems to have a problem with defines over multiple lines, so this has to be one long line
#define _CONSUME_AS_LONG_AS(conditionFails) while (true) { ch = readChar(); if (ch==-1 || (!(conditionFails) || str.len >= LUCENE_MAX_WORD_LEN)) { break; } str.appendChar(ch);}
#define CONSUME_ALPHAS _CONSUME_AS_LONG_AS(ALPHA)
#define CONSUME_DIGITS _CONSUME_AS_LONG_AS(DIGIT)
/* otherMatches is a condition (possibly compound) under which a character
** that's not an ALNUM or UNDERSCORE can be considered not to break the
** span. Callers should pass false if only ALNUM/UNDERSCORE are acceptable. */
#define CONSUME_WORD _CONSUME_AS_LONG_AS(ALNUM || UNDERSCORE)
#define CONSUME_WORD_OR(otherMatches) _CONSUME_AS_LONG_AS(ALNUM || UNDERSCORE || (otherMatches))
/* It is considered that "nothing of value" has been read if:
** a) The "read head" hasn't moved since specialCharPos was established.
** or
** b) The "read head" has moved by one character, but that character was
** either whitespace or not among the characters found in the body of
** a token (deliberately doesn't include the likes of '@'/'&'). */
#define CONSUMED_NOTHING_OF_VALUE (rdPos == specialCharPos || (rdPos == specialCharPos+1 && ( SPACE || !(ALNUM || DOT || DASH || UNDERSCORE) )))
#define RIGHTMOST(sb) (sb.getBuffer()[sb.len-1])
#define RIGHTMOST_IS(sb, c) (RIGHTMOST(sb) == c)
/* To discard the last character in a StringBuffer, we decrement the buffer's
** length indicator and move the terminator back by one character. */
#define SHAVE_RIGHTMOST(sb) (sb.getBuffer()[--sb.len] = '\0')
#define REMOVE_TRAILING_CHARS(sb, charMatchesCondition) { TCHAR* sbBuf = sb.getBuffer(); for (int32_t i = sb.len-1; i >= 0; i--) { TCHAR c = sbBuf[i]; if (charMatchesCondition) { sbBuf[--sb.len] = '\0'; } else {break;}}}
/* Does StringBuffer sb contain any of the characters in string ofThese? */
#define CONTAINS_ANY(sb, ofThese) (_tcscspn(sb.getBuffer(), _T(ofThese)) != static_cast<size_t>(sb.len))
StandardTokenizer::StandardTokenizer(Reader* reader):
rd(_CLNEW FastCharStream(reader)),
/* rdPos is zero-based. It starts at -1, and will advance to the first
** position when readChar() is first called. */
rdPos(-1),
tokenStart(-1)
{
}
StandardTokenizer::~StandardTokenizer() {
_CLDELETE(rd);
}
int StandardTokenizer::readChar() {
/* Increment by 1 because we're speaking in terms of characters, not
** necessarily bytes: */
rdPos++;
return rd->GetNext();
}
void StandardTokenizer::unReadChar() {
rd->UnGet();
rdPos--;
}
inline bool StandardTokenizer::setToken(Token* t, StringBuffer* sb, TokenTypes tokenCode) {
t->setStartOffset(tokenStart);
t->setEndOffset(tokenStart+sb->length());
t->setType(tokenImage[tokenCode]);
sb->getBuffer(); //null terminates the buffer
t->resetTermTextLen();
return true;
}
/*inline Token* StandardTokenizer::createToken(const TCHAR* text, int32_t tokenLength, TokenTypes tokenCode) {
CND_PRECONDITION (tokenLength > 0,"Token length is less than or equal to zero");
return _CLNEW Token(text, tokenStart, tokenStart+tokenLength, tokenImage[tokenCode]);
}*/
bool StandardTokenizer::next(Token* t) {
int ch=0;
while (!EOS) {
ch = readChar();
if ( ch == 0 || ch == -1 ){
continue;
} else if (SPACE) {
continue;
} else if (ALPHA || UNDERSCORE) {
tokenStart = rdPos;
return ReadAlphaNum(ch,t);
} else if (DIGIT || NEGATIVE_SIGN_ || DECIMAL) {
tokenStart = rdPos;
/* ReadNumber returns NULL if it fails to extract a valid number; in
** that case, we just continue. */
if (ReadNumber(NULL, ch,t))
return true;
}else if (((TCHAR)ch>>8)&&((TCHAR)ch>=0xa0)){//add by Fox_Hawk
//todo: this is new code...
t->growBuffer(LUCENE_MAX_WORD_LEN);//make sure token can hold the next word
StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText
str.appendChar(ch);
setToken(t,&str, CL_NS2(analysis,standard)::ALPHANUM);
}
}
return false;
}
bool StandardTokenizer::ReadNumber(const TCHAR* previousNumber, const TCHAR prev,Token* t) {
/* previousNumber is only non-NULL if this function already read a complete
** number in a previous recursion, yet has been asked to read additional
** numeric segments. For example, in the HOST "192.168.1.3", "192.168" is
** a complete number, but this function will recurse to read the "1.3",
** generating a single HOST token "192.168.1.3". */
t->growBuffer(LUCENE_MAX_WORD_LEN);//make sure token can hold the next word
StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText
TokenTypes tokenType;
bool decExhausted;
if (previousNumber != NULL) {
str.prepend(previousNumber);
tokenType = CL_NS2(analysis,standard)::HOST;
decExhausted = false;
} else {
tokenType = CL_NS2(analysis,standard)::NUM;
decExhausted = (prev == '.');
}
if ( str.len >= LUCENE_MAX_WORD_LEN ){
//if a number is too long, i would say there is no point
//storing it, because its going to be the wrong number anyway?
//what do people think?
return false;
}
str.appendChar(prev);
const bool signExhausted = (prev == '-');
int ch = prev;
CONSUME_DIGITS;
if (str.len < 2 /* CONSUME_DIGITS didn't find any digits. */
&& (
(signExhausted && !DECIMAL)
|| (decExhausted /* && !DIGIT is implied, since CONSUME_DIGITS stopped on a non-digit. */)
)
)
{
/* We have either:
** a) a negative sign that's not followed by either digit(s) or a decimal
** b) a decimal that's not followed by digit(s)
** so this is not a valid number. */
if (!EOS) {
/* Unread the character that stopped CONSUME_DIGITS: */
unReadChar();
}
return false;
}
/* We just read a group of digits. Is it followed by a decimal symbol,
** implying that there might be another group of digits available? */
if (!EOS) {
if (DECIMAL) {
if ( str.len >= LUCENE_MAX_WORD_LEN )
return false; //read above for rationale
str.appendChar(ch);
} else {
unReadChar();
goto SUCCESSFULLY_EXTRACTED_NUMBER;
}
CONSUME_DIGITS;
if (!DIGIT && !DECIMAL) {
unReadChar();
} else if (!EOS && DECIMAL && _istdigit(rd->Peek())) {
/* We just read the fractional digit group, but it's also followed by
** a decimal symbol and at least one more digit, so this must be a
** HOST rather than a real number. */
return ReadNumber(str.getBuffer(), '.',t);
}
}
SUCCESSFULLY_EXTRACTED_NUMBER:
TCHAR rightmost = RIGHTMOST(str);
/* Don't including a trailing decimal point. */
if (rightmost == '.') {
SHAVE_RIGHTMOST(str);
unReadChar();
rightmost = RIGHTMOST(str);
}
/* If all we have left is a negative sign, it's not a valid number. */
if (rightmost == '-') {
CND_PRECONDITION (str.len == 1, "Number is invalid");
return false;
}
return setToken(t,&str,tokenType);
}
bool StandardTokenizer::ReadAlphaNum(const TCHAR prev, Token* t) {
t->growBuffer(LUCENE_MAX_WORD_LEN);//make sure token can hold the next word
StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText
if ( str.len < LUCENE_MAX_WORD_LEN ){
str.appendChar(prev);
int ch = prev;
CONSUME_WORD;
if (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) { //still have space for 1 more character?
switch(ch) { /* What follows the first alphanum segment? */
case '.':
str.appendChar('.');
return ReadDotted(&str, CL_NS2(analysis,standard)::UNKNOWN,t);
case '\'':
str.appendChar('\'');
return ReadApostrophe(&str,t);
case '@':
str.appendChar('@');
return ReadAt(&str,t);
case '&':
str.appendChar('&');
return ReadCompany(&str,t);
/* default: fall through to end of this function. */
}
}
}
return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM);
}
bool StandardTokenizer::ReadDotted(StringBuffer* _str, TokenTypes forcedType, Token* t) {
const int32_t specialCharPos = rdPos;
StringBuffer& str=*_str;
/* A segment of a "dotted" is not allowed to begin with another dot or a dash.
** Even though hosts, e-mail addresses, etc., could have a dotted-segment
** that begins with a dot or a dash, it's far more common in source text
** for a pattern like "abc.--def" to be intended as two tokens. */
int ch = rd->Peek();
if (!(DOT || DASH)) {
bool prevWasDot;
bool prevWasDash;
if (str.len == 0) {
prevWasDot = false;
prevWasDash = false;
} else {
prevWasDot = RIGHTMOST(str) == '.';
prevWasDash = RIGHTMOST(str) == '-';
}
while (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) {
ch = readChar();
const bool dot = ch == '.';
const bool dash = ch == '-';
if (!(ALNUM || UNDERSCORE || dot || dash)) {
break;
}
/* Multiple dots or dashes in succession end the token.
** Consider the following inputs:
** "Visit windowsupdate.microsoft.com--update today!"
** "In the U.S.A.--yes, even there!" */
if ((dot || dash) && (prevWasDot || prevWasDash)) {
/* We're not going to append the character we just read, in any case.
** As to the character before it (which is currently RIGHTMOST(str)):
** Unless RIGHTMOST(str) is a dot, in which we need to save it so the
** acronym-versus-host detection can work, we want to get rid of it. */
if (!prevWasDot) {
SHAVE_RIGHTMOST(str);
}
break;
}
str.appendChar(ch);
prevWasDot = dot;
prevWasDash = dash;
}
}
/* There's a potential StringBuffer.append call in the code above, which
** could cause str to reallocate its internal buffer. We must wait to
** obtain the optimization-oriented strBuf pointer until after the initial
** potentially realloc-triggering operations on str.
** Because there can be other such ops much later in this function, strBuf
** is guarded within a block to prevent its use during or after the calls
** that would potentially invalidate it. */
{ /* Begin block-guard of strBuf */
TCHAR* strBuf = str.getBuffer();
bool rightmostIsDot = RIGHTMOST_IS(str, '.');
if (CONSUMED_NOTHING_OF_VALUE) {
/* No more alphanums available for this token; shave trailing dot, if any. */
if (rightmostIsDot) {
SHAVE_RIGHTMOST(str);
}
/* If there are no dots remaining, this is a generic ALPHANUM. */
if (_tcschr(strBuf, '.') == NULL) {
forcedType = CL_NS2(analysis,standard)::ALPHANUM;
}
/* Check the token to see if it's an acronym. An acronym must have a
** letter in every even slot and a dot in every odd slot, including the
** last slot (for example, "U.S.A."). */
} else if (rightmostIsDot) {
bool isAcronym = true;
const int32_t upperCheckLimit = str.len - 1; /* -1 b/c we already checked the last slot. */
for (int32_t i = 0; i < upperCheckLimit; i++) {
const bool even = (i % 2 == 0);
ch = strBuf[i];
if ( (even && !ALPHA) || (!even && !DOT) ) {
isAcronym = false;
break;
}
}
if (isAcronym) {
forcedType = CL_NS2(analysis,standard)::ACRONYM;
} else {
/* If it's not an acronym, we don't want the trailing dot. */
SHAVE_RIGHTMOST(str);
/* If there are no dots remaining, this is a generic ALPHANUM. */
if (_tcschr(strBuf, '.') == NULL) {
forcedType = CL_NS2(analysis,standard)::ALPHANUM;
}
}
}
} /* End block-guard of strBuf */
if (!EOS) {
if (ch == '@' && str.len < LUCENE_MAX_WORD_LEN-1) {
str.appendChar('@');
return ReadAt(&str,t);
} else {
unReadChar();
}
}
return setToken(t,&str,CL_NS2(analysis,standard)::UNKNOWN
? forcedType : CL_NS2(analysis,standard)::HOST);
}
bool StandardTokenizer::ReadApostrophe(StringBuffer* _str, Token* t) {
StringBuffer& str=*_str;
TokenTypes tokenType = CL_NS2(analysis,standard)::APOSTROPHE;
const int32_t specialCharPos = rdPos;
int ch=0;
CONSUME_ALPHAS;
if (RIGHTMOST_IS(str, '\'') || CONSUMED_NOTHING_OF_VALUE) {
/* After the apostrophe, no more alphanums were available within this
** token; shave trailing apostrophe and revert to generic ALPHANUM. */
SHAVE_RIGHTMOST(str);
tokenType = CL_NS2(analysis,standard)::ALPHANUM;
}
if (!EOS) {
unReadChar();
}
return setToken(t,&str,tokenType);
}
bool StandardTokenizer::ReadAt(StringBuffer* str, Token* t) {
ReadDotted(str, CL_NS2(analysis,standard)::EMAIL,t);
/* JLucene grammar indicates dots/digits not allowed in company name: */
if (!CONTAINS_ANY((*str), ".0123456789")) {
setToken(t,str,CL_NS2(analysis,standard)::COMPANY);
}
return true;
}
bool StandardTokenizer::ReadCompany(StringBuffer* _str, Token* t) {
StringBuffer& str = *_str;
const int32_t specialCharPos = rdPos;
int ch=0;
CONSUME_WORD;
if (CONSUMED_NOTHING_OF_VALUE) {
/* After the ampersand, no more alphanums were available within this
** token; shave trailing ampersand and revert to ALPHANUM. */
CND_PRECONDITION(RIGHTMOST_IS(str, '&'),"ReadCompany failed");
SHAVE_RIGHTMOST(str);
return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM);
}
if (!EOS) {
unReadChar();
}
return setToken(t,&str,CL_NS2(analysis,standard)::COMPANY);
}
CL_NS_END2
@@ -1,70 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_standard_StandardTokenizer
#define _lucene_analysis_standard_StandardTokenizer
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
#include "../AnalysisHeader.h"
#include "../Analyzers.h"
#include "StandardTokenizerConstants.h"
#include "CLucene/util/StringBuffer.h"
#include "CLucene/util/FastCharStream.h"
#include "CLucene/util/Reader.h"
CL_NS_DEF2(analysis,standard)
// This should be a good tokenizer for most European-language documents.
class StandardTokenizer: public Tokenizer {
private:
int32_t rdPos;
int32_t tokenStart;
// Advance by one character, incrementing rdPos and returning the character.
int readChar();
// Retreat by one character, decrementing rdPos.
void unReadChar();
// createToken centralizes token creation for auditing purposes.
//Token* createToken(CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode);
inline bool setToken(Token* t, CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode);
bool ReadDotted(CL_NS(util)::StringBuffer* str, TokenTypes forcedType,Token* t);
public:
CL_NS(util)::FastCharStream* rd;
// Constructs a tokenizer for this Reader.
StandardTokenizer(CL_NS(util)::Reader* reader);
~StandardTokenizer();
/** Returns the next token in the stream, or false at end-of-stream.
* The returned token's type is set to an element of
* StandardTokenizerConstants::tokenImage. */
bool next(Token* token);
// Reads for number like "1"/"1234.567", or IP address like "192.168.1.2".
bool ReadNumber(const TCHAR* previousNumber, const TCHAR prev, Token* t);
bool ReadAlphaNum(const TCHAR prev, Token* t);
// Reads for apostrophe-containing word.
bool ReadApostrophe(CL_NS(util)::StringBuffer* str, Token* t);
// Reads for something@... it may be a COMPANY name or a EMAIL address
bool ReadAt(CL_NS(util)::StringBuffer* str, Token* t);
// Reads for COMPANY name like AT&T.
bool ReadCompany(CL_NS(util)::StringBuffer* str, Token* t);
};
CL_NS_END2
#endif
@@ -1,46 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_analysis_standard_StandardTokenizerConstants
#define _lucene_analysis_standard_StandardTokenizerConstants
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
CL_NS_DEF2(analysis,standard)
enum TokenTypes {
_EOF,
UNKNOWN,
ALPHANUM,
APOSTROPHE,
ACRONYM,
COMPANY,
EMAIL,
HOST,
NUM
};
const static TCHAR* tokenImage[] = {
_T("<EOF>"),
_T("<UNKNOWN>"),
_T("<ALPHANUM>"),
_T("<APOSTROPHE>"),
_T("<ACRONYM>"),
_T("<COMPANY>"),
_T("<EMAIL>"),
_T("<HOST>"),
_T("<NUM>")
//_T("<P>"),
//_T("<HAS_DIGIT>"),
//_T("<ALPHA>"),
//_T("<LETTER>"),
//_T("<DIGIT>"),
//_T("<NOISE>"),
};
CL_NS_END2
#endif
@@ -1,71 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#if !defined(_lucene_COMPILER_BCB)
#define _lucene_COMPILER_BCB
// It is internal CLucene header - DO NOT include it directly
#include "CLucene/config/define_std.h"
#undef _CL_HAVE_STRTOLL
#undef _CL_HAVE_WCSTOLL
#define _LUCENE_PRAGMA_ONCE
#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning
#define LUCENE_DISABLE_HASHING
#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
#undef LUCENE_ENABLE_MEMLEAKTRACKING //it has been reported that this causes problems
#define fileSize filelength
#define fileSeek lseek
#define fileTell tell
#define fileStat stat
#define fileHandleStat fstat
#define _sleep Sleep
#define O_RANDOM 0
//java long type
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
//#define LUCENE_INT64_MAX _I64_MAX
//java int type
typedef int int32_t;
typedef unsigned int uint32_t;
//#define LUCENE_INT32_MAX INT_MAX
//java byte type
typedef unsigned char uint8_t;
//#define LUCENE_UINT8_MAX UCHAR_MAX
//floating point type
typedef double float_t;
//required type
typedef int intptr_t;
#define _CL_ILONG(x) x ## L
#define _ILONGLONG(x) x ## i64
#elif !defined(_lucene_COMPILER_BCB2)
#define _lucene_COMPILER_BCB2
//second inclusion
#define _open open
#define _timeb timeb
#define _ftime ::ftime
#define _rename rename
#define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH)
#elif !defined(_lucene_COMPILER_BCB3)
#define _lucene_COMPILER_BCB3
//third inclusion
#endif
@@ -1,162 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#if !defined(_lucene_COMPILER_GCC)
#define _lucene_COMPILER_GCC
// It is internal CLucene header - DO NOT include it directly
#if !defined(_SUPPRESS_MAKE_BASED_CONFIG)
#include "CLucene/clucene-config.h" //make clucene-config.h file
#endif
#if defined(_ASCII)
#undef _UCS2
#elif defined(_UCS2)
//
#else
#define CL_CHARSET_GUESS
#endif
//dont allow FS_MMAP if mmap is not available
#if defined(LUCENE_FS_MMAP) && !defined(_CL_HAVE_MMAP)
#error "LUCENE_FS_MMAP is defined and MMap doesn't appear to be available"
#endif
#ifdef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS
#undef _LUCENE_DISABLE_EXCEPTIONS
#define _LUCENE_DISABLE_EXCEPTIONS
#error "this is bad if you made it here... your compiler seems not to have try/catch blocks."
#error "maybe you could implement an alternative solution for us? :)"
#endif
#ifndef _CL_HAVE_NAMESPACES
#define DISABLE_NAMESPACE
#endif
#define CL_NS_HASHING(func) __gnu_cxx::func //todo: is this best way?
#define LUCENE_DISABLE_HASHING
//define the file functions
#define fileSeek lseek
#define fileSize _filelength
#define fileStat stat
#define fileHandleStat fstat
#ifdef _CL_HAVE_TELL
#define fileTell tell
#else
//ftell (and probably soon ftell64) are POSIX standard functions, but tell and
//tell64 are not, so we define fileTell in terms of fileSeek.
#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR)
#endif
//this is needed early on so that CL_MAX_PATH can be correctly determined
//in the StdHeader.h. This was earlier causing problems with macosx.
//:: crash was due to realpath() that expects an output arguments that
//has at least the size of PATH_MAX (even if the result has a lower size)
#include <limits.h>
#ifndef _CL_HAVE_WCHAR_T
typedef unsigned short wchar_t;
#endif
#if defined(__CYGWIN__)
//cygwin seems to incorrectly define that it has wprintf???
#undef _CL_HAVE_WPRINTF
#elif defined(__MINGW32__)
#ifndef _CL_HAVE_WINDOWS_H
#define _CL_HAVE_WINDOWS_H
#endif
#endif
///////////////////////////////////////////////////////////////////////////////
//end _lucene_COMPILER_GCC1
#elif !defined(_lucene_COMPILER_GCC2)
#define _lucene_COMPILER_GCC2
//second inclusion
//types
#if defined(_CL_HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
#if defined(_CL_HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(_CL_HAVE_STDINT_H)
#include <stdint.h>
#else
#if _CL_SIZEOF_UNSIGNED_LONG_LONG==8
typedef unsigned long long uint64_t;
typedef long long int64_t;
#elif _CL_SIZEOF_UNSIGNED_LONG==8
typedef unsigned long uint64_t;
typedef long int64_t;
#else
#error I do not know what to use for a uint64_t.
#endif
/* Give us an unsigned 32-bit data type. */
#if _CL_SIZEOF_UNSIGNED_LONG==4
typedef unsigned long uint32_t;
typedef long int32_t;
#elif _CL_SIZEOF_UNSIGNED_INT==4
typedef unsigned int uint32_t;
typedef int int32_t;
#else
#error I do not know what to use for a uint32_t.
#endif
/* An unsigned 8-bit data type */
#if _CL_SIZEOF_UNSIGNED_CHAR==1
typedef unsigned char uint8_t;
#else
#error I do not know what to use for a uint8_t.
#endif
#endif
//second chance to fix default settings
//this must be defined later, otherwise it messes up
//the standard libraries
#if !defined(__MINGW32__)
#define _close ::close
#define _read ::read
#endif
//now that int64_t is defined, we can define this...
#ifndef _CL_HAVE_FILELENGTH
#undef fileSize
#define fileSize lucene_filelength
int64_t lucene_filelength(int handle);
#endif
#elif !defined(_lucene_COMPILER_GCC3)
#define _lucene_COMPILER_GCC3
//third inclusion
#if !defined(__MINGW32__)
//define replacements
#define O_RANDOM 0
#undef O_BINARY
#define O_BINARY 0
#define _S_IREAD 0444
#define _S_IWRITE 0333 // write and execute permissions
//some functions that are needed - not charset dependent and not tchar type functions
#define _open open
#define _sleep(x) usleep(x*1000) //_sleep should be in millis, usleep is in micros
#define _write write
#define _snprintf snprintf
//clucene uses ascii for filename interactions
#define _realpath(rel,abs) realpath(rel,abs)
#define _mkdir(x) mkdir(x,0777)
#define _unlink unlink
#else
#define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH)
#endif
//also required by mingw
#define _rename rename
#endif
@@ -1,119 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#if !defined(_lucene_COMPILER_MSVC)
#define _lucene_COMPILER_MSVC
// It is internal CLucene header - DO NOT include it directly
#include "CLucene/config/define_std.h"
#if (_MSC_VER >= 1300)
//>= 7.0
# pragma warning(disable: 4512) // This would be very annoying
#define CL_NS_HASHING(func) stdext::func
#define LUCENE_STATIC_CONSTANT_SYNTAX 1
#elif (_MSC_VER >= 1200)
//6.0
#ifdef LUCENE_ENABLE_MEMLEAKTRACKING
#define _CLDELETE_CARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x); x=NULL;}
#define _CLDELETE_CaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x); x=NULL;}
#define _CLDELETE_LCARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x);}
#define _CLDELETE_LCaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x);}
#else
#define _CLDELETE_CARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x); x=NULL;}
#define _CLDELETE_CaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x); x=NULL;}
#define _CLDELETE_LCARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x);}
#define _CLDELETE_LCaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x);}
#endif
#define LUCENE_STATIC_CONSTANT_SYNTAX 2
# pragma warning(disable: 4786) // This would be very annoying
namespace std{
# undef min // just in case
# undef max // just in case
#define min(a,b) (a>b?b:a)
#define max(a,b) (a>b?a:b)
}
//only 7.0+ has these function
#undef _CL_HAVE_LLTOA
#undef _CL_HAVE_LLTOAW
#undef _CL_HAVE_INTPTR_T
#undef _CL_HAVE_WCSTOLL
#undef _CL_HAVE_STRTOLL
#undef _CL_HAVE_HASH_MAP
#undef _CL_HAVE_HASH_SET
#else
# error "This version of MSVC has not been tested. Please uncomment this line to try anyway. Please send a report to the Clucene's administration if successful"
#endif
#if _MSC_VER >= 1020
#define _LUCENE_PRAGMA_ONCE
#endif
#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning
//if we are compiling using single-threaded libraries, we can disable multi-threading stuff
#if !defined(_MT) && !defined(_CL_DISABLE_MULTITHREADING)
#define _CL_DISABLE_MULTITHREADING
#endif
//msvc supports large files
#ifdef _LARGE_FILES
# define fileSize _filelengthi64
# define fileSeek _lseeki64
# define fileTell _telli64
# define fileStat _stati64
# define fileHandleStat _fstati64
#else
# define fileSize _filelength
# define fileSeek _lseek
# define fileTell _tell
# define fileStat _stat
# define fileHandleStat _fstat
#endif
//_rename is not defined???
#define _rename rename
#define CL_MAX_PATH 260 //give the windef.h value for this...
#define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH)
//java long type
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
//#define LUCENE_INT64_MAX _I64_MAX
//java int type
typedef int int32_t;
typedef unsigned int uint32_t;
//#define LUCENE_INT32_MAX INT_MAX
//java byte type
typedef unsigned char uint8_t;
//#define LUCENE_UINT8_MAX UCHAR_MAX
//floating point type
typedef double float_t;
#define _CL_ILONG(x) x ## L
#define _ILONGLONG(x) x ## i64
#elif !defined(_lucene_COMPILER_MSVC2)
#define _lucene_COMPILER_MSVC2
//second inclusion
#elif !defined(_lucene_COMPILER_MSVC3)
#define _lucene_COMPILER_MSVC3
//third inclusion
#endif
@@ -1,15 +0,0 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
configdir = $(lsrcdir)/config
confighdir = $(includedir)/CLucene/config
libclucene_la_SOURCES += $(configdir)/gunichartables.cpp
libclucene_la_SOURCES += $(configdir)/repl_lltot.cpp
libclucene_la_SOURCES += $(configdir)/repl_tcscasecmp.cpp
libclucene_la_SOURCES += $(configdir)/repl_tcslwr.cpp
libclucene_la_SOURCES += $(configdir)/repl_tcstod.cpp
libclucene_la_SOURCES += $(configdir)/repl_tcstoll.cpp
libclucene_la_SOURCES += $(configdir)/repl_tprintf.cpp
libclucene_la_SOURCES += $(configdir)/threads.cpp
libclucene_la_SOURCES += $(configdir)/utf8.cpp
configh_HEADERS = $(configdir)/*.h
@@ -1,19 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
// It is internal CLucene header - DO NOT include it directly
# define PATH_DELIMITER _T("/")
# define PATH_DELIMITERA "/"
# define PATH_DELIMITERC '/'
# if (__GNUC__ < 3) && !defined( __APPLE_CC__)
// GCC strange "ignore std" mode works better if you pretend everything
// is in the std namespace, for the most part.
# define LUCENE_NO_STDC_NAMESPACE
# endif
#undef _T //apple has something else strange here...
@@ -1,12 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
// It is internal CLucene header - DO NOT include it directly
# define PATH_DELIMITER _T("/")
# define PATH_DELIMITERA "/"
# define PATH_DELIMITERC '/'
@@ -1,11 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
// It is internal CLucene header - DO NOT include it directly
# define PATH_DELIMITER _T("\\")
# define PATH_DELIMITERA "\\"
# define PATH_DELIMITERC '\\'
@@ -1,241 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#if !defined(lucene_compiler_h)
#define lucene_compiler_h
#if defined(_MBCS) || defined(_ASCII)
#undef _ASCII
#undef _UCS2
#define _ASCII
#elif defined(_UNICODE)
#define _UCS2
#elif !defined(_UCS2)
#define _UCS2
#endif
//msvc needs unicode define so that it uses unicode library
#ifdef _UCS2
#undef _UNICODE
#define _UNICODE
#undef _ASCII
#else
#undef _UNICODE
#undef _UCS2
#endif
////////////////////////////////////////////////////////////////////
// Figure out what compiler we are using
////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__ICL) && !defined (__COMO__)
#define _CLCOMPILER_MSVC _MSC_VER
#endif
#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__)
#include "CLucene/config/CompilerGcc.h"
#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"
#elif defined __BORLANDC__
#include "CLucene/config/CompilerBcb.h"
#else
//Unable to identify the compiler, issue error diagnostic.
//Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
//Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Now include platform specific definitions
////////////////////////////////////////////////////////////////////
/* Operating system recognition (basic) */
#if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__Lynx__)
#undef _UNIX
#define _UNIX 1
#include "CLucene/config/PlatformUnix.h"
#elif defined(macintosh) || defined (_MAC) || defined(__APPLE__)
#undef _MAC
#define _MAC 1
#include "CLucene/config/PlatformMac.h"
#elif defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__)
#undef _WIN32
#define _WIN32
#include "CLucene/config/PlatformWin32.h"
#elif defined (__WIN16) || defined (WIN16) || defined (_WIN16)
#undef _WIN16
#define _WIN16
#error "CLucene has not been tested on this platform. Please send a report to the lucene administrators if you are able to successfully compile"
#else
#error "CLucene could not identify the platform."
#endif /* platforms */
////////////////////////////////////////////////////////////////////
// Now we take all that we have learnt, and define some things
////////////////////////////////////////////////////////////////////
//lets just say that we can always do unicode! :)
#ifdef CL_CHARSET_GUESS
#define _UCS2
#endif
#if defined(_ASCII)
#undef _UCS2
#elif defined(_UCS2)
#undef _ASCII
#endif
#ifndef _LUCENE_NO_NEW_STYLE_CASTS
#define __CONST_CAST(typ,var) const_cast<typ>(var)
#define __REINTERPRET_CAST(typ,var) reinterpret_cast<typ>(var)
#else
#define __CONST_CAST(typ,var) ((typ)(var))
#define __REINTERPRET_CAST,var) ((typ)(var))
#endif
//cnd-debug exit command
#ifndef debugFatalExit
#define debugFatalExit(ret) exit(ret)
#endif
#ifndef _CL_ILONG
#define _CL_ILONG(x) x ## L
#endif
#ifndef _ILONGLONG
#define _ILONGLONG(x) x ## LL
#endif
//define whats the values of item intergers *should* be. we can check this in a test
#define LUCENE_INT64_MAX_SHOULDBE _ILONGLONG(0x7FFFFFFFFFFFFFFF)
#define LUCENE_INT32_MAX_SHOULDBE 0x7FFFFFFFL
#define LUCENE_UINT8_MAX_SHOULDBE 0xff
//maximum path length. only used for buffers that use fullpath.
//anything else should use a dynamic length.
#if defined(CL_MAX_PATH)
//do nothing...
#elif defined(PATH_MAX)
#define CL_MAX_PATH PATH_MAX
#elif defined(MAX_PATH)
#define CL_MAX_PATH MAX_PATH
#elif defined(_MAX_PATH)
#define CL_MAX_PATH _MAX_PATH
#else
#error "CL_MAX_PATH could not be determined"
#endif
//this is the max filename... for now its just the same,
//but this could change, so we use a different name
#define CL_MAX_NAME CL_MAX_PATH
//todo: this is a temporary fix for a potential buffer overflow...
//should never use this
#define CL_MAX_DIR CL_MAX_PATH*2
#ifdef _LARGE_FILES
#define LUCENE_MAX_FILELENGTH LUCENE_INT64_MAX_SHOULDBE
#else
#define LUCENE_MAX_FILELENGTH LUCENE_INT32_MAX_SHOULDBE
#endif
//use the LUCENE_STATIC_CONSTANT_SYNTAX to determine LUCENE_STATIC_CONSTANT
#ifndef LUCENE_STATIC_CONSTANT
//autoconf is not properly detecting the correct method for this, and since there's no real big
//harm in always using an enum, we'll probably just make this the default.
/*#if LUCENE_STATIC_CONSTANT_SYNTAX == 1
#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
#elif LUCENE_STATIC_CONSTANT_SYNTAX == 2*/
#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
/*#else
#error "LUCENE_STATIC_CONSTANT not defined, and/or LUCENE_STATIC_CONSTANT_SYNTAX is not defined to a valid value"
#endif*/
#endif
//end of lucene_compiler_h
#elif !defined(lucene_compiler_h2)
#define lucene_compiler_h2
//here we include the compiler header again, this gives the header a
//second chance at including stuff, after the main inclusions are complete
#if defined (__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__)
#include "CLucene/config/CompilerGcc.h"
#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"
#elif defined __BORLANDC__
#include "CLucene/config/CompilerBcb.h"
#else
//Unable to identify the compiler, issue error diagnostic.
//Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
//Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */
#ifndef _CL_HAVE_FLOAT_T
#ifdef _CL_HAVE_LONG_DOUBLE
typedef long double float_t; /* `float' expressions are evaluated as `long double'. */
#else
typedef double float_t;
#endif
#endif
/*todo: but need to define SIZEOF_VOID_P #if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
#ifndef _CL_HAVE_INTPTR_T
typedef int64_t intptr_t;
#endif
#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4)
#ifndef _CL_HAVE_INTPTR_T
typedef int32_t intptr_t;
#endif
#else
#error "void * is either >8 bytes or <= 2. In either case, I am confused."
#endif*/
#ifndef _CL_HAVE_INTPTR_T
typedef int64_t intptr_t;
#endif
//end of lucene_compiler_h2
#elif !defined(lucene_compiler_h3)
#define lucene_compiler_h3
//here we include the compiler header again, this gives the header a
//third chance at including stuff, after the main inclusions are complete
#if defined (__GNUC__ ) || defined(__SUNPRO_CC) || defined(__xlC__)
#include "CLucene/config/CompilerGcc.h"
#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"
#elif defined __BORLANDC__
#include "CLucene/config/CompilerBcb.h"
#else
//Unable to identify the compiler, issue error diagnostic.
//Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
//Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */
#endif
@@ -1,110 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef lucene_define_std
#define lucene_define_std
//define a standard list of defines.
//These defines represents a fairly complete compiler.
//Of course it is preferable to use the autoconf generated
//list, but then not all systems can do this :)
//we support long files - 64 bit file functions
#define _LARGE_FILES
//support namespaces
#define _CL_HAVE_NAMESPACES
//support try/catch blocks
#define _CL_HAVE_FUNCTION_TRY_BLOCKS
//the normal headers
#define _CL_STDC_HEADERS
#define _CL_HAVE_STDARG_H
#define _CL_HAVE_ALGORITHM
#define _CL_HAVE_FUNCTIONAL
#define _CL_HAVE_MATH_H
#define _CL_HAVE_STL
#define _CL_HAVE_HASH_MAP
#define _CL_HAVE_HASH_SET
#define _CL_HAVE_MAP
#define _CL_HAVE_SET
#define _CL_HAVE_LIST
#define _CL_HAVE_VECTOR
#define _CL_HAVE_STDEXCEPT
#define _CL_HAVE_ERRNO_H
#define _CL_HAVE_SYS_STAT_H
#define _CL_HAVE_FCNTL_H
//character & std tchar support
#define _CL_HAVE_TCHAR_H
#ifdef _UCS2
#define _CL_HAVE_WCTYPE_H
#define _CL_HAVE_WCSCPY
#define _CL_HAVE_WCSNCPY
#define _CL_HAVE_WCSCAT
#define _CL_HAVE_WCSCHR
#define _CL_HAVE_WCSSTR
#define _CL_HAVE_WCSLEN
#define _CL_HAVE_WCSCMP
#define _CL_HAVE_WCSNCMP
#define _CL_HAVE_WCSCSPN
#else
#define _CL_HAVE_CTYPE_H
#endif
//already have the normal structures
#define _CL_HAVE_FLOAT_T
#define _CL_HAVE_INTPTR_T
//system dependant:
#define _CL_HAVE_STRING_H //could be HAVE_STRINGS_H && HAVE_STRCHR
#define _CL_HAVE_SYS_TIMEB_H
#define _CL_HAVE_TIME_H
#if defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__)
#define _CL_HAVE_IO_H
#define _CL_HAVE_DIRECT_H
#define _CL_HAVE_WINDOWS_H
#else
#define _CL_HAVE_UNISTD_H
#endif
////////////////////////////////////////////////
//now for individual functions. some compilers
//miss these, so must individually define what
//we have
////////////////////////////////////////////////
//string functions
#define _CL_HAVE_STRLWR
#define _CL_HAVE_WCSLWR
#define _CL_HAVE_WCSCASECMP
#define _CL_HAVE_STRCASECMP
//formatting functions
#define _CL_HAVE_SNWPRINTF
#define _CL_HAVE_VSNWPRINTF
#define _CL_HAVE_WPRINTF
#define _CL_HAVE_SNPRINTF
#define _CL_HAVE_PRINTF
//conversion functions
#define _CL_HAVE_STRTOLL
#define _CL_HAVE_WCSTOLL
#define _CL_HAVE_WCSTOD
#define _CL_HAVE_LLTOA
#define _CL_HAVE_LLTOW
#define _CL_HAVE_INTPTR_T
//these ones are not standard (msvc)
//so you will probably need to undefine
//if you are not using msvc
#define _CL_HAVE_FILELENGTH
#endif
@@ -1,383 +0,0 @@
/*
* Copyright (C) 1999 Tom Tromey
* Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*
************************************************
* Also licensed with permission from Tom Tromey
* and Owen Taylor under the Apache license.
* Original location:
* http://cvs.gnome.org/viewcvs/glib/glib/guniprop.c?view=log
************************************************
*
* Copyright 2003-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "CLucene/StdHeader.h"
typedef unsigned long gunichar;
typedef unsigned short guint16;
typedef short gint16;
typedef char gchar;
typedef unsigned char guchar;
/* These are the possible character classifications.
* See http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
or http://www.unicode.org/Public/UNIDATA/UCD.html.
todo: i think there is a new version of the unicode, which we should use.
data is licensed like this: http://www.unicode.org/copyright.html... not sure but looks apache compatible
*/
typedef enum
{
G_UNICODE_CONTROL,
G_UNICODE_FORMAT,
G_UNICODE_UNASSIGNED,
G_UNICODE_PRIVATE_USE,
G_UNICODE_SURROGATE,
G_UNICODE_LOWERCASE_LETTER,
G_UNICODE_MODIFIER_LETTER,
G_UNICODE_OTHER_LETTER,
G_UNICODE_TITLECASE_LETTER,
G_UNICODE_UPPERCASE_LETTER,
G_UNICODE_COMBINING_MARK,
G_UNICODE_ENCLOSING_MARK,
G_UNICODE_NON_SPACING_MARK,
G_UNICODE_DECIMAL_NUMBER,
G_UNICODE_LETTER_NUMBER,
G_UNICODE_OTHER_NUMBER,
G_UNICODE_CONNECT_PUNCTUATION,
G_UNICODE_DASH_PUNCTUATION,
G_UNICODE_CLOSE_PUNCTUATION,
G_UNICODE_FINAL_PUNCTUATION,
G_UNICODE_INITIAL_PUNCTUATION,
G_UNICODE_OTHER_PUNCTUATION,
G_UNICODE_OPEN_PUNCTUATION,
G_UNICODE_CURRENCY_SYMBOL,
G_UNICODE_MODIFIER_SYMBOL,
G_UNICODE_MATH_SYMBOL,
G_UNICODE_OTHER_SYMBOL,
G_UNICODE_LINE_SEPARATOR,
G_UNICODE_PARAGRAPH_SEPARATOR,
G_UNICODE_SPACE_SEPARATOR
} GUnicodeType;
#include "gunichartables.h"
#define ATTR_TABLE(Page) (((Page) <= G_UNICODE_LAST_PAGE_PART1) \
? attr_table_part1[Page] \
: attr_table_part2[(Page) - 0xe00])
#define ATTTABLE(Page, Char) \
((ATTR_TABLE(Page) == G_UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))
#define TTYPE_PART1(Page, Char) \
((type_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
? (type_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \
: (type_data[type_table_part1[Page]][Char]))
#define TTYPE_PART2(Page, Char) \
((type_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
? (type_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \
: (type_data[type_table_part2[Page]][Char]))
#define TYPE(Char) \
(((Char) <= G_UNICODE_LAST_CHAR_PART1) \
? TTYPE_PART1 ((Char) >> 8, (Char) & 0xff) \
: (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \
? TTYPE_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
: G_UNICODE_UNASSIGNED))
/* Count the number of elements in an array. The array must be defined
* as such; using this with a dynamically allocated array will give
* incorrect results.
*/
#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS)
#ifdef _LUCENE_PRAGMA_WARNINGS
#pragma message ("===== Using internal character function =====")
#else
#warning "===== Using internal character function ====="
#endif
bool cl_isletter(TCHAR ch)
{
gunichar c=ch;
int t = TYPE ((gunichar)c);
switch(t)
{
case G_UNICODE_LOWERCASE_LETTER: return true;
case G_UNICODE_TITLECASE_LETTER: return true;
case G_UNICODE_UPPERCASE_LETTER: return true;
case G_UNICODE_MODIFIER_LETTER: return true;
case G_UNICODE_OTHER_LETTER: return true;
default: return false;
}
}
bool cl_isalnum(TCHAR ch)
{
gunichar c=ch;
int t = TYPE (c);
switch(t)
{
case G_UNICODE_LOWERCASE_LETTER: return true;
case G_UNICODE_TITLECASE_LETTER: return true;
case G_UNICODE_UPPERCASE_LETTER: return true;
case G_UNICODE_MODIFIER_LETTER: return true;
case G_UNICODE_OTHER_LETTER: return true;
case G_UNICODE_DECIMAL_NUMBER: return true;
case G_UNICODE_LETTER_NUMBER: return true;
case G_UNICODE_OTHER_NUMBER: return true;
default: return false;
}
}
bool cl_isdigit(TCHAR ch)
{
gunichar c=ch;
int t = TYPE ((gunichar)c);
switch(t)
{
case G_UNICODE_DECIMAL_NUMBER: return true;
case G_UNICODE_LETTER_NUMBER: return true;
case G_UNICODE_OTHER_NUMBER: return true;
default: return false;
}
}
/**
* cl_isspace:
* @c: a Unicode character
*
* Determines whether a character is a space, tab, or line separator
* (newline, carriage return, etc.). Given some UTF-8 text, obtain a
* character value with lucene_utf8towc().
*
* (Note: don't use this to do word breaking; you have to use
* Pango or equivalent to get word breaking right, the algorithm
* is fairly complex.)
*
* Return value: %TRUE if @c is a punctuation character
**/
bool cl_isspace (TCHAR ch)
{
gunichar c=ch;
switch (c)
{
/* special-case these since Unicode thinks they are not spaces */
case '\t':
case '\n':
case '\r':
case '\f':
return true;
default:
{
int t = TYPE ((gunichar)c);
return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
|| t == G_UNICODE_PARAGRAPH_SEPARATOR);
}
}
}
/**
* cl_tolower:
* @c: a Unicode character.
*
* Converts a character to lower case.
*
* Return value: the result of converting @c to lower case.
* If @c is not an upperlower or titlecase character,
* or has no lowercase equivalent @c is returned unchanged.
**/
TCHAR cl_tolower (TCHAR ch)
{
gunichar c=ch;
int t = TYPE ((gunichar)c);
if (t == G_UNICODE_UPPERCASE_LETTER)
{
gunichar val = ATTTABLE (c >> 8, c & 0xff);
if (val >= 0x1000000)
{
const gchar *p = special_case_table + val - 0x1000000;
int len=0;
wchar_t ret=0;
lucene_utf8towc(&ret,p,6);
#ifdef _UCS2
return ret;
#else
return LUCENE_OOR_CHAR(ret);
#endif
//return cl_utf8_get_char (p, &len);
}else
return val ? val : c;
}else if (t == G_UNICODE_TITLECASE_LETTER){
unsigned int i;
for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
{
if (title_table[i][0] == c)
return title_table[i][2];
}
}
return c;
}
/**
* cl_toupper:
* @c: a Unicode character
*
* Converts a character to uppercase.
*
* Return value: the result of converting @c to uppercase.
* If @c is not an lowercase or titlecase character,
* or has no upper case equivalent @c is returned unchanged.
**/
TCHAR cl_toupper (TCHAR ch)
{
gunichar c=ch;
int t = TYPE (c);
if (t == G_UNICODE_LOWERCASE_LETTER)
{
gunichar val = ATTTABLE (c >> 8, c & 0xff);
if (val >= 0x1000000)
{
const gchar *p = special_case_table + val - 0x1000000;
wchar_t ret=0;
lucene_utf8towc(&ret,p,6);
#ifdef _UCS2
return ret;
#else
return LUCENE_OOR_CHAR(ret);
#endif
//return lucene_utf8towc (p);
}
else
return val ? val : c;
}
else if (t == G_UNICODE_TITLECASE_LETTER)
{
unsigned int i;
for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
{
if (title_table[i][0] == c)
return title_table[i][1];
}
}
return c;
}
/**
* cl_tcasefold:
* @str: a unicode string
*
* Converts a string into a form that is independent of case. The
* result will not correspond to any particular case, but can be
* compared for equality or ordered with the results of calling
* cl_tcasefold() on other strings.
*
* Note that calling cl_tcasefold() followed by g_utf8_collate() is
* only an approximation to the correct linguistic case insensitive
* ordering, though it is a fairly good one. Getting this exactly
* right would require a more sophisticated collation function that
* takes case sensitivity into account. GLib does not currently
* provide such a function.
*
* Return value: a newly allocated string, that is a
* case independent form of @str.
**/
TCHAR cl_tcasefold(const TCHAR ch){
int start = 0;
int end = G_N_ELEMENTS (casefold_table);
if (ch >= casefold_table[start].ch &&
ch <= casefold_table[end - 1].ch)
{
while (1)
{
int half = (start + end) / 2;
if (ch == casefold_table[half].ch)
{
wchar_t ret=0;
lucene_utf8towc(&ret,casefold_table[half].data,6);
#ifdef _UCS2
return ret;
#else
LUCENE_OOR_CHAR(ret)
#endif
}else if (half == start){
break;
}else if (ch > casefold_table[half].ch){
start = half;
}else{
end = half;
}
}
}
return cl_tolower(ch);
}
//this function was not taken from gnome
TCHAR* cl_tcscasefold( TCHAR * str, int len ) //len default is -1
{
TCHAR *p = str;
while ((len < 0 || p < str + len) && *p)
{
*p = cl_tcasefold(*p);
p++;
}
return str;
}
//this function was not taken from gnome
int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src){
TCHAR f,l;
do{
f = cl_tcasefold( (*(dst++)) );
l = cl_tcasefold( (*(src++)) );
} while ( (f) && (f == l) );
return (int)(f - l);
}
#endif
File diff suppressed because it is too large Load Diff
@@ -1,47 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
TCHAR* lucene_i64tot(
int64_t value, /* [I] Value to be converted */
TCHAR* str, /* [O] Destination for the converted value */
int radix) /* [I] Number base for conversion */
{
uint64_t val;
int negative;
TCHAR buffer[65];
TCHAR* pos;
int digit;
if (value < 0 && radix == 10) {
negative = 1;
val = -value;
} else {
negative = 0;
val = value;
} /* if */
pos = &buffer[64];
*pos = '\0';
do {
digit = val % radix;
val = val / radix;
if (digit < 10) {
*--pos = '0' + digit;
} else {
*--pos = 'a' + digit - 10;
} /* if */
} while (val != 0L);
if (negative) {
*--pos = '-';
} /* if */
_tcsncpy(str,pos,&buffer[64] - pos + 1); //needed for unicode to work
return str;
}
@@ -1,102 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _CL_HAVE_TCHAR_H
#if defined(_UCS2)
#define TCHAR wchar_t
//note: descriptions with * in front have replacement functions
//formatting functions
#define _sntprintf swprintf //* make a formatted a string
#define _tprintf wprintf //* print a formatted string
//this one has no replacement functions yet, but it is only used in the tests
#define _vsntprintf vsnwprintf //* print a formatted string using variable arguments
//we are using the internal functions of the compiler here
//if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse
//will be replaced by internal functions
#define _istalnum iswalnum //* alpha/numeric char check
#define _istalpha iswalpha //* alpha char check
#define _istspace iswspace //* space char check
#define _istdigit iswdigit //* digit char check
#define _totlower towlower //* convert char to lower case
#define _totupper towupper //* convert char to lower case
#define _tcslwr wcslwr //* convert string to lower case
//these are the string handling functions
//we may need to create wide-character/multi-byte replacements for these
#define _tcscpy wcscpy //copy a string to another string
#define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
#define _tcscat wcscat //copy a string onto the end of the other string
#define _tcschr wcschr //find location of one character
#define _tcsstr wcsstr //find location of a string
#define _tcslen wcslen //get length of a string
#define _tcscmp wcscmp //case sensitive compare two strings
#define _tcsncmp wcsncmp //case sensitive compare two strings
#define _tcscspn wcscspn //location of any of a set of character in a string
#ifdef _CL_HAVE_WCSICMP
#define _tcsicmp wcsicmp //* case insensitive compare two string
#else
#define _tcsicmp wcscasecmp //* case insensitive compare two string
#endif
//conversion functions
#define _tcstod wcstod //convert a string to a double
#define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
#define _i64tot lltow //* converts a 64 bit integer to a string (with base)
#else //if defined(_ASCII)
#define TCHAR char
//formatting functions
#define _sntprintf snprintf
#define _tprintf printf
#define _vsntprintf vsnprintf
//we are using the internal functions of the compiler here
//if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse
//will be replaced by internal functions
#define _istalnum isalnum
#define _istalpha isalpha
#define _istspace isspace
#define _istdigit isdigit
#define _totlower tolower
#define _totupper toupper
#define _tcslwr strlwr
//these are the string handling functions
#define _tcscpy strcpy
#define _tcsncpy strncpy
#define _tcscat strcat
#define _tcschr strchr
#define _tcsstr strstr
#define _tcslen strlen
#define _tcscmp strcmp
#define _tcsncmp strncmp
#define _tcsicmp strcasecmp
#define _tcscspn strcspn
//converstion methods
#define _tcstod strtod
#define _tcstoi64 strtoll
#define _i64tot lltoa
#endif
#else //HAVE_TCHAR_H
#include <tchar.h>
//some tchar headers miss these...
#ifndef _tcstoi64
#if defined(_UCS2)
#define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
#else
#define _tcstoi64 strtoll
#endif
#endif
#endif //HAVE_TCHAR_H
@@ -1,21 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
int lucene_tcscasecmp(const TCHAR * sa, const TCHAR * sb){
TCHAR ca,cb;
if (sa == sb)
return 0;
do{
ca = _totlower( (*(sa++)) );
cb = _totlower( (*(sb++)) );
} while ( ca != L'\0' && (ca == cb) );
return (int)(ca - cb);
}
@@ -1,15 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
TCHAR* lucene_tcslwr( TCHAR* str )
{
TCHAR* ret = str;
for ( ; *str; str++) *str = _totlower(*str);
return ret;
}
@@ -1,23 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#ifndef _ASCII
double lucene_tcstod(const TCHAR *value, TCHAR **end){
int32_t len = _tcslen(value)+1;
char* avalue=_CL_NEWARRAY(char,len);
char* aend=NULL;
STRCPY_TtoA(avalue,value,len);
double ret = strtod(avalue,&aend);
*end=(TCHAR*)value+(aend-avalue);
_CLDELETE_CaARRAY(avalue);
return ret;
}
#endif
@@ -1,46 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix){
#define LUCENE_TCSTOI64_RADIX(x,r) ((x>=_T('0') && x<=_T('9'))?x-_T('0'):((x>=_T('a') && x<=_T('z'))?x-_T('a')+10:((x>=_T('A') && x<=_T('Z'))?x-_T('A')+10:1000)))
if (radix < 2 || radix > 36)
return 0;
/* Skip white space. */
while (_istspace (*str))
++str;
int sign=1;
if ( str[0] == _T('+') )
str++;
else if ( str[0] == _T('-') ){
sign = -1;
str++;
}
*end=(TCHAR*)str;
long r = -1;
while ( (r=LUCENE_TCSTOI64_RADIX(*end[0],radix)) >=0 && r<radix )
(*end)++;
TCHAR* p = (*end)-1;
int64_t ret = 0;
int pos = 0;
for ( ;p>=str;p-- ){
int i=LUCENE_TCSTOI64_RADIX(p[0],radix);
if ( pos == 0 )
ret=i;
else
ret += (int64_t)pow((float_t)radix,(float_t)pos) * i; //todo: might be quicker with a different pow overload
pos++;
}
return sign*ret;
}
@@ -1,149 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#include "CLucene/StdHeader.h"
#include "CLucene/util/StringBuffer.h"
#ifdef __CL_INCLUDE_TPRINTF
CL_NS_USE(util)
//print a variable argument to a stream
//currently special number formatting is not supported. it is very minimalistic
void lucene_vfnwprintf(StringBuffer* buffer, size_t count, const wchar_t * format, va_list& valist){
const wchar_t *iter = format;
StringBuffer* tmp = NULL;
if ( buffer == NULL )
tmp = _CLNEW StringBuffer;
else
tmp = buffer;
while (*iter)
{
while (*iter && *iter != '%')
{
tmp->appendChar(*iter++);
}
if (*iter == '%')
{
if (iter[1] == '%')
{
//just print a %
tmp->appendChar('%');
iter += 2;
continue;
}
iter++;
switch (*iter)
{
case 's':
{
//todo: this is faulty. it doesn't heed count
//print a string or null
TCHAR *wstr = va_arg(valist, TCHAR *);
if ( !wstr )
wstr = _T("(null)");
tmp->append(wstr);
iter++;
break;
}
case 'c':
tmp->appendChar((TCHAR)va_arg(valist, int));
iter++;
break;
default:
{
//todo: this is faulty. it doesn't heed count
if (*iter == 'p')
tmp->appendInt((int32_t)va_arg(valist, long));
else
{
if (*iter == 'a' || *iter == 'A' ||
*iter == 'e' || *iter == 'E' ||
*iter == 'f' || *iter == 'F' ||
*iter == 'g' || *iter == 'G')
tmp->appendFloat((float_t)va_arg(valist, double),8);
else if (*iter == 'd' || *iter == 'i' ){
tmp->appendInt((int32_t)va_arg(valist, int));
}else if (*iter == 'l' ){
TCHAR b[100];
_i64tot((int64_t)va_arg(valist, int64_t),b,10);
tmp->append(b);
}/*else{
TCHAR b[100];
_i64tot((int64_t)va_arg(valist, void*),b,10);
tmp->append(b);
}*/
}
iter++;
break;
}
}
}
}
if ( buffer == NULL ){
//we are supposed to be writing to the console
#ifdef _UCS2
TCHAR* pointer = tmp->getBuffer();
char ob[MB_LEN_MAX];
size_t v;
size_t len = tmp->length();
for (size_t i=0;i<len;i++){
v = wctomb(ob,*pointer);
if ( v > 0 ){
ob[v]='\0';
fputs(ob,stdout);
}
pointer++;
}
#else
fputs(tmp->getBuffer(),stdout);
#endif
_CLDELETE(tmp);
}
}
//print a list of arguments to a string
int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...){
va_list ap;
va_start(ap, format);
StringBuffer buffer;
lucene_vfnwprintf(&buffer,count,format,ap);
va_end(ap);
int ret = min((int32_t)count,buffer.length());
_tcsncpy(strbuf,buffer.getBuffer(),ret);
return ret;
}
//print a list of arguments to the stdout
void lucene_wprintf(const wchar_t * format, ...){
va_list ap;
va_start(ap, format);
lucene_vfnwprintf(NULL,LUCENE_INT32_MAX_SHOULDBE,format,ap);
va_end(ap);
}
//print a variable argument to a string
int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap){
StringBuffer buffer;
lucene_vfnwprintf(&buffer,count,format,ap);
int ret = min((int32_t)count,buffer.length());
_tcsncpy(strbuf,buffer.getBuffer(),ret);
return ret;
}
#endif //__CL_INCLUDE_TPRINTF
@@ -1,121 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_repl_wchar_h
#define _lucene_repl_wchar_h
#ifdef _UCS2
#ifndef _CL_HAVE_WCSCPY
//copy a string to another string
#error wcscpy is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSNCPY
//copy a specified amount of one string to another string.
#error wcsncpy is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSCAT
//copy a string onto the end of the other string
#error wcscat is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSCHR
//find location of one character
#error wcschr is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSSTR
//find location of a string
#error wcspy is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSLEN
//get length of a string
#error wcslen is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSCMP
//case sensitive compare two strings
#error wcscmp is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSNCMP
//case sensitive compare two strings of a specified length
#error wcsncmp is not defined, and a licensed replacement has not been written yet
#endif
#ifndef _CL_HAVE_WCSCSPN
//Return the length of the maximum initial segment
//of WCS which contains only wide-characters not in REJECT.
#error wcscspn is not defined, and a licensed replacement has not been written yet
#endif
#endif //_UCS2
//string function replacements
#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSCASECMP)) || (defined(_ASCII) && !defined(_CL_HAVE_STRCASECMP))
int lucene_tcscasecmp(const TCHAR *, const TCHAR *);
#undef _tcsicmp
#define _tcsicmp lucene_tcscasecmp
#endif
#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSLWR)) || (defined(_ASCII) && !defined(_CL_HAVE_STRLWR))
TCHAR* lucene_tcslwr( TCHAR* str );
#undef _tcslwr
#define _tcslwr lucene_tcslwr
#endif
//conversion functions
#if (defined(_ASCII) && !defined(_CL_HAVE_LLTOA)) || (defined(_UCS2) && !defined(_CL_HAVE_LLTOW))
TCHAR* lucene_i64tot( int64_t value, TCHAR* str, int radix);
#undef _i64tot
#define _i64tot lucene_i64tot
#endif
#if (defined(_UCS2) && !defined(_CL_HAVE_WCSTOLL)) || (defined(_ASCII) && !defined(_CL_HAVE_STRTOLL))
int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix);
#undef _tcstoi64
#define _tcstoi64 lucene_tcstoi64
#endif
#if defined(_UCS2) && !defined(_CL_HAVE_WCSTOD)
double lucene_tcstod(const TCHAR *value, TCHAR **end);
#undef _tcstod
#define _tcstod lucene_tcstod
#endif
//printf functions
#if defined(_UCS2) && (!defined(_CL_HAVE_SNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) )
#undef _sntprintf
#define _sntprintf lucene_snwprintf
int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...);
#ifndef __CL_INCLUDE_TPRINTF
#define __CL_INCLUDE_TPRINTF
#endif
#endif
#if defined(_UCS2) && !defined(_CL_HAVE_WPRINTF)
#undef _tprintf
#define _tprintf lucene_wprintf
void lucene_wprintf(const wchar_t * format, ...);
#ifndef __CL_INCLUDE_TPRINTF
#define __CL_INCLUDE_TPRINTF
#endif
#endif
#if defined(_UCS2) && (!defined(_CL_HAVE_VSNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) )
#undef _vsntprintf
#define _vsntprintf lucene_vsnwprintf
int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap);
#ifndef __CL_INCLUDE_TPRINTF
#define __CL_INCLUDE_TPRINTF
#endif
#endif
//todo: if _CL_HAVE_SNPRINTF_BUG fails(snprintf overflow),we should use our own
//function. but we don't have it currently, and our functions are dubious anyway...
#endif //end of _lucene_repl_wchar_h
@@ -1,70 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
//NOTE: do not include this file directly, it is included from lucene internally.
#ifndef lucene_config_threadCSection_h
#define lucene_config_threadCSection_h
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once
#endif
CL_NS_DEF(util)
#if !defined(LUCENE_USE_WINDOWS_H) && !defined(_WINDOWS_)
//we have not explicity included windows.h and windows.h has
//not been included (check _WINDOWS_), then we must define
//our own definitions to the thread locking functions:
struct CRITICAL_SECTION
{
struct critical_section_debug * DebugInfo;
long LockCount;
long RecursionCount;
void * OwningThread;
void * LockSemaphore;
#if defined(_WIN64)
unsigned __int64 SpinCount;
#else
unsigned long SpinCount;
#endif
};
#endif
///a windows implementation of the lock mutex
///todo: boost has a InterlockedExchange way of locking too. More backwards compatible/faster???
class mutex_win32
{
private:
CRITICAL_SECTION mtx;
public:
mutex_win32(const mutex_win32& clone);
mutex_win32();
~mutex_win32();
void lock();
void unlock();
};
class CLuceneThreadIdCompare
{
public:
enum
{ // parameters for hash table
bucket_size = 4, // 0 < bucket_size
min_buckets = 8
}; // min_buckets = 2 ^^ N, 0 < N
bool operator()( DWORD t1, DWORD t2 ) const{
return t1 < t2;
}
};
#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_win32
#define _LUCENE_CURRTHREADID GetCurrentThreadId()
#define _LUCENE_THREADID_TYPE DWORD
CL_NS_END
#endif //lucene_config_threadCSection_h
@@ -1,58 +0,0 @@
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
//NOTE: do not include this file directly, it is included from lucene internally.
#ifndef lucene_config_threadPthread_h
#define lucene_config_threadPthread_h
#include <pthread.h>
CL_NS_DEF(util)
///a posix implementation of the lock mutex
///todo: we need a spinlock implemenation for usage in reference counting
class mutex_pthread
{
private:
pthread_mutex_t mtx;
public:
mutex_pthread(const mutex_pthread& clone);
mutex_pthread();
~mutex_pthread();
void lock();
void unlock();
private:
#ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE
pthread_t lockOwner;
unsigned int lockCount;
#endif
};
#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_pthread
#define _LUCENE_CURRTHREADID pthread_self()
#define _LUCENE_THREADID_TYPE pthread_t
class CLuceneThreadIdCompare
{
public:
enum
{ // parameters for hash table
bucket_size = 4, // 0 < bucket_size
min_buckets = 8
}; // min_buckets = 2 ^^ N, 0 < N
bool operator()( pthread_t t1, pthread_t t2 ) const{
return t1 < t2;
}
};
CL_NS_END
#endif //lucene_config_threadPthread_h

Some files were not shown because too many files have changed in this diff Show More