~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/pandora-plugin

  • Committer: Monty Taylor
  • Date: 2010-12-26 03:00:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226030037-2qcfxg5ryamekd56
Cleaned through ha0ha.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
3
#  Copyright (C) 2009 Sun Microsystems, Inc.
4
 
#  Copyright (C) 2010, 2011 Monty Taylor
5
4
#
6
5
#  This program is free software; you can redistribute it and/or modify
7
6
#  it under the terms of the GNU General Public License as published by
134
133
 
135
134
noinst_HEADERS=
136
135
nobase_include_HEADERS=
137
 
nobase_pkginclude_HEADERS=
138
136
check_PROGRAMS=
139
137
noinst_LTLIBRARIES=
140
138
bin_PROGRAMS=
144
142
  if plugin['headers'] != "":
145
143
    plugin_file.write("noinst_HEADERS += %(headers)s\n" % plugin)
146
144
  if plugin['install_headers'] != "":
147
 
    plugin_file.write("nobase_pkginclude_HEADERS += %(install_headers)s\n" % plugin)
 
145
    plugin_file.write("nobase_include_HEADERS += %(install_headers)s\n" % plugin)
148
146
  if plugin['testsuite']:
149
147
    if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "":
150
148
      plugin_file.write("EXTRA_DIST += %(testsuitedir)s\n" % plugin)
153
151
%(libname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
154
152
%(libname)s_la_LIBADD=%(libs)s
155
153
%(libname)s_la_DEPENDENCIES=%(libs)s
156
 
%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='%(author)s' -DPANDORA_MODULE_TITLE='%(title)s' -DPANDORA_MODULE_VERSION='%(version)s' -DPANDORA_MODULE_LICENSE=%(license)s %(cppflags)s
 
154
%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='"%(author)s"' -DPANDORA_MODULE_TITLE='"%(title)s"' -DPANDORA_MODULE_VERSION='"%(version)s"' -DPANDORA_MODULE_LICENSE=%(license)s %(cppflags)s
157
155
%(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
158
156
%(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
159
157
%(libname)s_la_SOURCES=%(sources)s
245
243
    with_%(name)s_plugin="%(enabled)s"
246
244
    requested_%(name)s_plugin="no"
247
245
  ])
248
 
AC_ARG_WITH([static-%(name_with_dashes)s-plugin],[
249
 
AS_HELP_STRING([--with-static-%(name_with_dashes)s-plugin],[Build Archive Storage Engine. @<:@default=%(static_yesno)s@:>@])
250
 
AS_HELP_STRING([--without-static-%(name_with_dashes)s-plugin],[Disable building Archive Storage Engine])
251
 
  ],[
252
 
    with_static_%(name)s_plugin=${withval}
253
 
  ],[
254
 
    with_static_%(name)s_plugin=%(static_yesno)s
255
 
])
256
 
AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[
257
 
  shared_%(name)s_plugin=no
258
 
  ],[
259
 
  shared_%(name)s_plugin=yes
260
 
])
261
246
AC_ARG_ENABLE([%(name_with_dashes)s-plugin],[
262
247
dnl indented wierd to make the help output correct
263
248
AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Enable loading %(title)s by default. @<:@default=%(default_yesno)s@:>@])
287
272
""" % plugin)
288
273
  if not plugin['unconditional']:
289
274
    plugin_ac.write("""
290
 
AM_CONDITIONAL([%(static_build_conditional_tag)s],
291
 
               [test %(build_conditional)s -a ! %(shared_build)s])
292
 
AM_CONDITIONAL([%(shared_build_conditional_tag)s],
293
 
               [test %(build_conditional)s -a %(shared_build)s])
294
275
AM_CONDITIONAL([%(build_conditional_tag)s],
295
276
               [test %(build_conditional)s])
296
277
    """ % plugin)
297
278
 
298
279
  plugin_ac.write("""
299
 
AS_IF([test "x$with_%(name)s_plugin" = "xyes"],[
 
280
AS_IF([test "x$with_%(name)s_plugin" = "xyes"],
 
281
    [
300
282
""" % plugin)
301
283
  if plugin['testsuite']:
302
284
    plugin_ac.write("""
303
285
      pandora_plugin_test_list="%(name)s,${pandora_plugin_test_list}"
304
286
    """ % plugin)
305
 
  plugin_ac.write("""
306
 
      AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[
307
 
 
 
287
  if plugin['static']:
 
288
    plugin_ac.write("""
308
289
        AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[
309
290
          pandora_builtin_load_list="%(module_name)s,${pandora_builtin_load_list}"
310
291
          pandora_builtin_load_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_load_symbols_list}"
313
294
        pandora_builtin_list="%(module_name)s,${pandora_builtin_list}"
314
295
        pandora_builtin_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_symbols_list}"
315
296
        pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(libname)s.la"
316
 
     ],[
 
297
    """ % plugin)
 
298
 
 
299
  else:
 
300
    plugin_ac.write("""
317
301
        AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[
318
302
          pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
319
303
        ])
320
 
    ])
321
304
    """ % plugin)
322
 
  plugin_ac.write("])\n")
 
305
  plugin_ac.write("      ])\n")
323
306
 
324
307
def fix_file_paths(plugin, files):
325
308
  # TODO: determine path to plugin dir relative to top_srcdir... append it to
364
347
      plugin['extra_dist']=" ".join([os.path.join(plugin['rel_path'],f) for f in plugin['extra_dist'].split()])
365
348
 
366
349
 
367
 
    if plugin['static']:
368
 
      plugin['static_yesno']="yes"
369
 
    else:
370
 
      plugin['static_yesno']="no"
371
350
    plugin['build_conditional_tag']= "BUILD_%s_PLUGIN" % plugin['name'].upper()
372
 
    plugin['shared_build_conditional_tag']= "BUILD_%s_PLUGIN_SHARED" % plugin['name'].upper()
373
 
    plugin['static_build_conditional_tag']= "BUILD_%s_PLUGIN_STATIC" % plugin['name'].upper()
374
351
    plugin['name_with_dashes']= plugin['name'].replace('_','-')
375
352
    if plugin.has_key('build_conditional'):
376
353
      plugin['has_build_conditional']=True
378
355
    else:
379
356
      plugin['has_build_conditional']=False
380
357
      plugin['build_conditional']='"x${with_%(name)s_plugin}" = "xyes"' %plugin
381
 
    plugin['shared_build']='"x${shared_%(name)s_plugin}" = "xyes"' %plugin
382
358
 
383
359
    if plugin['install']:
384
360
      plugin['library_type']= 'pkgplugin'
534
510
  if plugin['headers'] != "":
535
511
    plugin_am.write("noinst_HEADERS += %(headers)s\n" % plugin)
536
512
  if plugin['install_headers'] != "":
537
 
    plugin_am.write("nobase_pkginclude_HEADERS += %(install_headers)s\n" % plugin)
 
513
    plugin_am.write("nobase_include_HEADERS += %(install_headers)s\n" % plugin)
538
514
  if plugin['testsuite']:
539
515
    if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "":
540
516
      plugin_am.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin)
542
518
    plugin_am.write("EXTRA_DIST += %(rel_path)s/%(dist_testsuite)s\n" % plugin)
543
519
  if plugin['docs'] is not None:
544
520
    plugin_am.write("EXTRA_DIST += ${top_srcdir}/%(rel_path)s/docs/*.rst\n" % plugin)
545
 
  plugin_am.write("""
 
521
  if plugin['static']:
 
522
    plugin_am.write("""
546
523
%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
547
 
# Include sources in EXTRA_DIST because we might not build this, but we
548
 
# still want the sources to wind up in a tarball
549
 
EXTRA_DIST += %(rel_path)s/plugin.ini %(sources)s
550
 
if %(static_build_conditional_tag)s
 
524
EXTRA_DIST += %(rel_path)s/plugin.ini
 
525
if %(build_conditional_tag)s
551
526
  noinst_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la
552
527
  %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s
553
528
  %(root_plugin_dir)s_%(libname)s_la_DEPENDENCIES=%(libs)s
554
529
  %(root_plugin_dir)s_%(libname)s_la_LDFLAGS=$(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
555
 
  %(root_plugin_dir)s_%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='%(author)s' -DPANDORA_MODULE_TITLE='%(title)s' -DPANDORA_MODULE_VERSION='%(version)s' -DPANDORA_MODULE_LICENSE=%(license)s -DPANDORA_MODULE_DEPENDENCIES='%(dependencies)s' %(cppflags)s
 
530
  %(root_plugin_dir)s_%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='"%(author)s"' -DPANDORA_MODULE_TITLE='"%(title)s"' -DPANDORA_MODULE_VERSION='"%(version)s"' -DPANDORA_MODULE_LICENSE=%(license)s -DPANDORA_MODULE_DEPENDENCIES='"%(dependencies)s"' %(cppflags)s
556
531
  %(root_plugin_dir)s_%(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
557
532
  %(root_plugin_dir)s_%(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
558
533
  %(root_plugin_dir)s_%(libname)s_la_SOURCES=%(sources)s
559
534
  check_PROGRAMS += %(tests)s
560
535
  PANDORA_DYNAMIC_LDADDS+=${top_builddir}/%(root_plugin_dir)s/%(libname)s.la
561
536
endif
 
537
""" % plugin)
 
538
  else:
 
539
    plugin_am.write("""
 
540
%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
562
541
EXTRA_DIST += %(rel_path)s/plugin.ini
563
 
if %(shared_build_conditional_tag)s
 
542
if %(build_conditional_tag)s
564
543
  %(library_type)s_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la
565
544
  %(root_plugin_dir)s_%(libname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
566
545
  %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s
567
546
  %(root_plugin_dir)s_%(libname)s_la_DEPENDENCIES=%(libs)s
568
 
  %(root_plugin_dir)s_%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='%(author)s' -DPANDORA_MODULE_TITLE='%(title)s' -DPANDORA_MODULE_VERSION='%(version)s' -DPANDORA_MODULE_LICENSE=%(license)s -DPANDORA_MODULE_DEPENDENCIES='%(dependencies)s' %(cppflags)s
 
547
  %(root_plugin_dir)s_%(libname)s_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(module_name)s -DPANDORA_MODULE_AUTHOR='"%(author)s"' -DPANDORA_MODULE_TITLE='"%(title)s"' -DPANDORA_MODULE_VERSION='"%(version)s"' -DPANDORA_MODULE_LICENSE=%(license)s -DPANDORA_MODULE_DEPENDENCIES='"%(dependencies)s"' %(cppflags)s
569
548
  %(root_plugin_dir)s_%(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
570
549
  %(root_plugin_dir)s_%(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
571
550
  %(root_plugin_dir)s_%(libname)s_la_SOURCES=%(sources)s
683
662
if not os.path.exists("config/pandora-plugin.ac") or "write" in actions:
684
663
  plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac'))
685
664
  plugin_ac_file.write("dnl Generated file, run make to rebuild\n")
686
 
  plugin_ac_file.write("""
687
 
AC_ARG_WITH([all-static],[
688
 
AS_HELP_STRING([--with-all-static],[Link all plugins staticly into the server @<:@default=no@:>@])
689
 
],[
690
 
    with_all_static="$withval"
691
 
    ],[
692
 
    with_all_static=no
693
 
])
694
 
  """)
695
665
 
696
666
if os.path.exists("docs/plugins"):
697
667
  if not os.path.exists("docs/plugins/list.rst") or "write" in actions: