*/
#include <Python.h>
+#include "python/py3compat.h"
#include "includes.h"
#include <pyldb.h>
#include <pytalloc.h>
{ NULL }
};
-void initdsdb_dns(void);
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "dsdb_dns",
+ .m_doc = "Python bindings for the DNS objects in the directory service databases.",
+ .m_size = -1,
+ .m_methods = py_dsdb_dns_methods,
+};
-void initdsdb_dns(void)
+MODULE_INIT_FUNC(dsdb_dns)
{
PyObject *m;
- m = Py_InitModule3("dsdb_dns", py_dsdb_dns_methods,
- "Python bindings for the DNS objects in the directory service databases.");
+ m = PyModule_Create(&moduledef);
+
if (m == NULL)
- return;
+ return NULL;
+
+ return m;
}
deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
enabled=bld.AD_DC_BUILD_IS_ENABLED())
+for env in bld.gen_python_environments():
+ pyldb_util = bld.pyembed_libname('pyldb-util')
+ pyrpc_util = bld.pyembed_libname('pyrpc_util')
+ pytalloc_util = bld.pyembed_libname('pytalloc-util')
-bld.SAMBA_PYTHON('python_dsdb_dns',
+ bld.SAMBA_PYTHON('python_dsdb_dns',
source='pydns.c',
- deps='samdb pyldb-util pyrpc_util dnsserver_common pytalloc-util',
+ deps='samdb %s %s dnsserver_common %s' % (pyldb_util, pyrpc_util, pytalloc_util),
realname='samba/dsdb_dns.so')