.c.o:
@echo "Compiling $<"
- @$(CC) $(CFLAGS) -c $< -o $@
+ @$(CC) $(WAF_BUILD_INC) $(CFLAGS) -c $< -o $@
.c.po:
@echo "Compiling $< with -fPIC"
- @$(CC) $(CFLAGS) -fPIC -c $< -o $@
+ @$(CC) $(WAF_BUILD_INC) $(CFLAGS) -fPIC -c $< -o $@
.cpp.o:
@echo "Compiling $< with -fPIC"
$(pythonscriptdir)/openchange/mapistore.$(SHLIBEXT): pyopenchange/pymapistore.c \
mapiproxy/libmapistore.$(SHLIBEXT).$(PACKAGE_VERSION)
@echo "Linking $@"
- @$(CC) $(CFLAGS) $(DSOOPT) $(LDFLAGS) -o $@ $^ `$(PYTHON_CONFIG) --cflags --libs` $(LIBS)
+ @$(CC) $(WAF_BUILD_INC) $(CFLAGS) $(DSOOPT) $(LDFLAGS) -o $@ $^ `$(PYTHON_CONFIG) --cflags --libs` $(LIBS)
$(pythonscriptdir)/openchange/mapistoredb.$(SHLIBEXT): pyopenchange/pymapistoredb.c \
mapiproxy/libmapistore.$(SHLIBEXT).$(PACKAGE_VERSION)
@echo "Linking $@"
- @$(CC) $(CFLAGS) $(DSOOPT) $(LDFLAGS) -o $@ $^ `$(PYTHON_CONFIG) --cflags --libs` $(LIBS)
+ @$(CC) $(WAF_BUILD_INC) $(CFLAGS) $(DSOOPT) $(LDFLAGS) -o $@ $^ `$(PYTHON_CONFIG) --cflags --libs` $(LIBS)
pyopenchange/pymapi_properties.c: \
libmapi/conf/mapi-properties \
-DLZFU_DATADIR=\"$(datadir)/mapitest/lzfu\" \
-DHAVE_ICAL_0_46=@have_libical_0_46@
+WAF_BUILD_INC=-Imapiproxy/libmapistore -Imapiproxy/libmapistore/indexing/gen_ndr
+
# This value should be determined by configure at some point
SHLIBEXT=so
PACKAGE_VERSION=@PACKAGE_VERSION@
--- /dev/null
+# simple makefile wrapper to run waf
+
+WAF=WAF_MAKE=1 PATH=buildtools:../../buildtools:$$PATH waf
+
+all:
+ $(WAF) build
+
+install:
+ $(WAF) install
+
+uninstall:
+ $(WAF) uninstall
+
+dist:
+ touch .tmplock
+ WAFLOCK=.tmplock $(WAF) dist
+
+distcheck:
+ touch .tmplock
+ WAFLOCK=.tmplock $(WAF) distcheck
+
+clean:
+ $(WAF) clean
+
+distclean:
+ $(WAF) distclean
+
+reconfigure: configure
+ $(WAF) reconfigure
+
+show_waf_options:
+ $(WAF) --help
+
+pydoctor:
+ $(WAF) pydoctor
+
+bin/%:: FORCE
+ $(WAF) --targets=`basename $@`
+FORCE:
--- /dev/null
+#!/bin/sh
+
+PREVPATH=`dirname $0`
+
+if [ -f $PREVPATH/../../buildtools/waf ]; then
+ WAF=../../buildtools/waf
+elif [ -f $PREVPATH/buildtools/bin/waf ]; then
+ WAF=./buildtools/waf
+else
+ echo "replace: Unable to find waf"
+ exit 1
+fi
+
+# using JOBS=1 gives maximum compatibility with
+# systems like AIX which have broken threading in python
+JOBS=1
+export JOBS
+
+cd . || exit 1
+$WAF configure "$@" || exit 1
+cd $PREVPATH
\ No newline at end of file
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "mapiproxy/libmapistore/mapistore_errors.h"
-#include "mapiproxy/libmapistore/mapistore.h"
-#include "mapiproxy/libmapistore/mapistore_private.h"
-#include "mapiproxy/libmapistore/mapistore_common.h"
+#include <string.h>
+
+#include "mapistore_errors.h"
+#include "mapistore.h"
+#include "mapistore_private.h"
+#include "mapistore_common.h"
+
+#include <param.h>
/**
\file mapistoredb.c
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "mapiproxy/libmapistore/mapistore_errors.h"
-#include "mapiproxy/libmapistore/mapistore.h"
-#include "mapiproxy/libmapistore/mapistore_private.h"
+#include "mapistore_errors.h"
+#include "mapistore.h"
+#include "mapistore_private.h"
/**
\details Get accessor for netbiosname
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "mapiproxy/libmapistore/mapistore_errors.h"
-#include "mapiproxy/libmapistore/mapistore.h"
-#include "mapiproxy/libmapistore/mapistore_private.h"
-#include "mapiproxy/libmapistore/mapistore_common.h"
+#include <string.h>
+
+#include "mapistore_errors.h"
+#include "mapistore.h"
+#include "mapistore_private.h"
+#include "mapistore_common.h"
/**
\file mapistoredb_namedprops.c
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <fcntl.h>
#include <string.h>
-#include "mapiproxy/libmapistore/mapistore_errors.h"
-#include "mapiproxy/libmapistore/mapistore.h"
-#include "mapiproxy/libmapistore/mapistore_common.h"
-#include "mapiproxy/libmapistore/mapistore_private.h"
-#include "gen_ndr/ndr_mapistore_indexing_db.h"
+#include "mapistore_errors.h"
+#include "mapistore.h"
+#include "mapistore_common.h"
+#include "mapistore_private.h"
+#include "ndr_mapistore_indexing_db.h"
#include <dlinklist.h>
#include <tdb.h>
MAPISTORE_RETVAL_IF(!mictx, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
MAPISTORE_RETVAL_IF(!mapistore_uri, MAPISTORE_ERR_NOT_INITIALIZED, NULL);
+ mem_ctx = talloc_named(NULL, 0, __FUNCTION__);
+
key.dptr = (unsigned char *)talloc_asprintf(mem_ctx, MAPISTORE_INDEXING_URI, mapistore_uri);
key.dsize = strlen((const char *)key.dptr);
#include <talloc.h>
#include <util/debug.h>
-#include "libmapi/libmapi.h"
+/* #include "libmapi/libmapi.h" */
+#include "gen_ndr/exchange.h"
#include "mapistore_defs.h"
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#define _GNU_SOURCE 1
#include <string.h>
#include "mapistore_errors.h"
#include "mapistore_common.h"
#include "mapistore_private.h"
#include <dlinklist.h>
-#include "libmapi/libmapi_private.h"
#include <tdb.h>
+char *strcasestr(const char *, const char *);
+
/**
\details Search the indexing record matching the username
flist->count = 0;
tmp_uri = uri;
- while ((substr = strcasestr(uri, "0x")) != NULL) {
+ while ((substr = (char *)strcasestr((const char *) uri, "0x")) != NULL) {
folder = talloc_strndup(mstore_ctx, substr, 18);
flist->folderID[flist->count] = strtoull(folder, NULL, 16);
if (flist->folderID[flist->count] != fmid) {
#include "mapistore_backend.h"
#include "mapistore_common.h"
#include <dlinklist.h>
-#include "libmapi/libmapi_private.h"
#include <string.h>
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+/* #include "config.h" */
#include <stdio.h>
#include <string.h>
#include "mapistore.h"
#include "mapistore_common.h"
#include "mapistore_private.h"
-#include "libmapi/libmapi_private.h"
#include <ldb.h>
#include <sys/stat.h>
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
-
-#include "mapiproxy/libmapistore/indexing/gen_ndr/mapistore_indexing_db.h"
-
#include <talloc.h>
+#include "mapistore_indexing_db.h"
+
#ifndef ISDOT
#define ISDOT(path) ( \
*((const char *)(path)) == '.' && \
#include "mapistore_common.h"
#include "mapistore_private.h"
#include <dlinklist.h>
-#include "libmapi/libmapi_private.h"
#include <tdb.h>
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
-#include <stdio.h>
-#include <string.h>
-
#include "mapistore_errors.h"
#include "mapistore.h"
#include "mapistore_private.h"
#include <dlinklist.h>
+#include <stdio.h>
+#include <string.h>
+
static struct tdb_wrap *tdb_list;
/* destroy the last connection to a tdb */
--- /dev/null
+from waflib.Task import Task
+from waflib.TaskGen import extension
+import os
+
+APPNAME = 'mapistore'
+VERSION = '2.0'
+
+top = '.'
+out = 'build'
+
+def options(ctx):
+ ctx.load('compiler_c')
+ ctx.add_option('--datadir',type='string',default='',dest='datadir',help='read-only application data')
+
+def configure(conf):
+ conf.load('compiler_c')
+
+ conf.env.CPPFLAGS = ['-Wall', '-Werror', '-g3', '-fstrict-aliasing', '-Wp,-D_FORTIFY_SOURCE=2',
+ '-Wmissing-prototypes', '-Wstrict-prototypes']
+
+ prefix = conf.options.prefix
+ libdir = os.path.join(prefix, "lib")
+ mapistore_path = os.path.join(prefix, 'private/mapistore')
+
+ def getstr(varname):
+ return getattr(conf.options,varname,'')
+
+ datadir=getstr('datadir')
+ if not datadir:datadir=os.path.join(prefix,'share')
+
+ conf.define('MAPISTORE_MAPPING_PATH', mapistore_path)
+ conf.define('MAPISTORE_DBPATH', os.path.join(mapistore_path, "mapistore.ldb"))
+ conf.define('MAPISTORE_LDIF', datadir)
+ conf.define('MAPISTORE_BACKEND_INSTALLDIR', os.path.join(libdir, "mapistore_backends"))
+ conf.define('MAPISTORE_DB_NAMEDPROPS_PATH', os.path.join(mapistore_path, "mapistore_named_properties.ldb"))
+
+ conf.check_cfg(atleast_pkgconfig_version='0.20')
+
+ conf.check_cfg(package='tdb',
+ args=['tdb >= 0.25', '--cflags', '--libs'],
+ uselib_store='TDB',
+ msg="Checking for 'tdb 0.25'")
+
+ conf.check_cfg(package='talloc',
+ args=['talloc >= 0.25', '--cflags', '--libs'],
+ uselib_store='TALLOC',
+ msg="Checking for 'talloc 0.25'")
+
+ conf.check_cfg(package='samba-hostconfig',
+ args=['--cflags', '--libs'],
+ uselib_store='SAMBA-HOSTCONFIG',
+ msg="Checking for 'samba-hostconfig 0.25'")
+
+ try:
+ conf.find_program('pidl', var='PIDL')
+ except ctx.errors.ConfigurationError:
+ self.fatal("PIDL compiler not found")
+
+ print("prefix is " + conf.options.prefix)
+
+def post(ctx):
+ if ctx.cmd == 'install':
+ ctx.exec_command('/sbin/ldconfig')
+
+class idl(Task):
+ run_str = '${PIDL} --outputdir=indexing --header --ndr-parser -- ${SRC}'
+ color = 'BLUE'
+ ext_out = ['.h', '.c']
+
+@extension('.idl')
+def process_idl(self, node):
+ ndr_node = node.change_ext('.c')
+
+ try:
+ ndr_node.name.index("ndr_")
+ except ValueError:
+ ndr_node.name = "ndr_" + ndr_node.name
+ h_node = node.change_ext('.h')
+ self.create_task('idl', node, [ndr_node, h_node])
+ self.source.append(ndr_node)
+
+def build(bld):
+ bld.shlib(
+ source = [
+ 'indexing/mapistore_indexing_db.idl',
+ 'mapistore_interface.c',
+ 'mapistore_processing.c',
+ 'mapistore_backend.c',
+ 'mapistore_backend_defaults.c',
+ 'mapistore_backend_public.c',
+ 'mapistore_tdb_wrap.c',
+ 'mapistore_ldb_wrap.c',
+ 'mapistore_namedprops.c',
+ 'mapistore_indexing.c',
+ 'database/mapistoredb.c',
+ 'database/mapistoredb_conf.c',
+ 'database/mapistoredb_namedprops.c',
+ 'indexing/mapistore_indexing.c',
+ ],
+ target = 'mapistore',
+ includes = ['.', '../../', 'build/indexing'],
+ use = ['TDB', 'TALLOC', 'SAMBA-HOSTCONFIG'])
+
+ bld.add_post_fun(post)
#define __PYMAPISTORE_H_
#include <Python.h>
-#include "mapiproxy/libmapistore/mapistore_errors.h"
-#include "mapiproxy/libmapistore/mapistore.h"
-#include "mapiproxy/libmapistore/mapistore_private.h"
+#include "mapistore_errors.h"
+#include "mapistore.h"
+#include "mapistore_private.h"
typedef struct {
PyObject_HEAD