~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/pandora-plugin

Merged meta-info branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# Find plugins in the tree and add them to the build system 
20
20
 
21
21
import ConfigParser, os, sys
 
22
import datetime, time
22
23
 
23
24
top_srcdir='.'
24
25
top_builddir='.'
144
145
lib%(name)s_plugin_la_LDFLAGS=-module -avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
145
146
lib%(name)s_plugin_la_LIBADD=%(libs)s
146
147
lib%(name)s_plugin_la_DEPENDENCIES=%(libs)s
147
 
lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(name)s %(cppflags)s
 
148
lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(name)s -DPANDORA_MODULE_AUTHOR="%(author)s" -DPANDORA_MODULE_TITLE="%(title)s" -DPANDORA_MODULE_VERSION="%(version)s" -DPANDORA_MODULE_LICENSE=%(license)s %(cppflags)s
148
149
lib%(name)s_plugin_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
149
150
lib%(name)s_plugin_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
150
151
 
235
236
  if plugin['static']:
236
237
    #pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
237
238
    plugin_ac.write("""
238
 
        pandora_builtin_list="builtin_%(name)s_plugin,${pandora_builtin_list}"
 
239
        pandora_builtin_list="_drizzled_%(name)s_plugin_,${pandora_builtin_list}"
239
240
        pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/plugin/lib%(name)s_plugin.la"
240
241
        PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} %(plugin_dep_libs)s"
241
242
""" % plugin)
297
298
 
298
299
def read_plugin_ini(plugin_dir):
299
300
    plugin_file= os.path.join(plugin_dir,plugin_ini_fname)
300
 
    parser=ConfigParser.ConfigParser(defaults=dict(sources="",headers="", cflags="",cppflags="",cxxflags="", libs="", ldflags=""))
 
301
    plugin_defaults= dict(sources="",
 
302
                          headers="",
 
303
                          cflags="",
 
304
                          cppflags="",
 
305
                          cxxflags="",
 
306
                          libs="",
 
307
                          ldflags="",
 
308
                          author="",
 
309
                          title="",
 
310
                          description="",
 
311
                          license="PLUGIN_LICENSE_GPL",
 
312
                          name=os.path.basename(plugin_dir),
 
313
                          load_by_default="False",
 
314
                          static="False")
 
315
    parser=ConfigParser.ConfigParser(defaults= plugin_defaults)
301
316
    parser.read(plugin_file)
302
317
    plugin=dict(parser.items('plugin'))
303
 
    if not plugin.has_key('name'):
304
 
      plugin['name']= os.path.basename(plugin_dir)
305
318
    if plugin_dir == '.':
306
319
      if not plugin.has_key('url'):
307
320
        print "External Plugins are required to specifiy a url"
310
323
      if plugin_dir == '.' and not plugin.has_key('version'):
311
324
        print "External Plugins are required to specifiy a version"
312
325
        sys.exit(1)
 
326
    if not plugin.has_key('version'):
 
327
      plugin['version']=datetime.date.fromtimestamp(time.time()).isoformat()
313
328
   
314
329
    if plugin.has_key('load_by_default'):
315
330
      plugin['load_by_default']=parser.getboolean('plugin','load_by_default')
316
 
    else:
317
 
      plugin['load_by_default']=False
318
331
    if plugin.has_key('static'):
319
332
      plugin['static']= parser.getboolean('plugin','static')
320
 
    else:
321
 
      plugin['static']= False
322
333
    if plugin.has_key('testsuite'):
323
334
      if plugin['testsuite'] == 'disable':
324
335
        plugin['testsuite']= False
362
373
  plugin_lib%(name)s_plugin_la_LIBADD=%(libs)s
363
374
  plugin_lib%(name)s_plugin_la_DEPENDENCIES=%(libs)s
364
375
  plugin_lib%(name)s_plugin_la_LDFLAGS=$(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)  
365
 
  plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_MODULE_NAME=%(name)s %(cppflags)s
 
376
  plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_MODULE_NAME=%(name)s -DPANDORA_MODULE_AUTHOR="%(author)s" -DPANDORA_MODULE_TITLE="%(title)s" -DPANDORA_MODULE_VERSION="%(version)s" -DPANDORA_MODULE_LICENSE=%(license)s %(cppflags)s
366
377
  plugin_lib%(name)s_plugin_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
367
378
  plugin_lib%(name)s_plugin_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
368
379
 
379
390
  plugin_lib%(name)s_plugin_la_LDFLAGS=-module -avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
380
391
  plugin_lib%(name)s_plugin_la_LIBADD=%(libs)s
381
392
  plugin_lib%(name)s_plugin_la_DEPENDENCIES=%(libs)s
382
 
  plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(name)s %(cppflags)s
 
393
  plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(name)s -DPANDORA_MODULE_AUTHOR="%(author)s" -DPANDORA_MODULE_TITLE="%(title)s" -DPANDORA_MODULE_VERSION="%(version)s" -DPANDORA_MODULE_LICENSE=%(license)s %(cppflags)s
383
394
  plugin_lib%(name)s_plugin_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
384
395
  plugin_lib%(name)s_plugin_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
385
396