82
def write_external_configure(plugin, plugin_file):
83
"""Write the initial bits of the configure.ac file"""
84
if not os.path.exists('m4'):
87
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
88
AC_INIT([%(name)s],[%(version)s],[%(url)s])
89
AC_CONFIG_SRCDIR([%(main_source)s])
90
AC_CONFIG_AUX_DIR(config)
92
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, force-gcc42,skip-visibility)
94
PANDORA_REQUIRE_LIBPROTOBUF
95
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
96
PANDORA_REQUIRE_PROTOC
99
PANDORA_REQUIRE_PTHREAD
100
PANDORA_REQUIRE_LIBDL
103
PANDORA_USE_BETTER_MALLOC
105
PANDORA_DRIZZLE_BUILD
108
write_plugin_ac(plugin, plugin_file)
110
plugin_file.write("""
111
AC_CONFIG_FILES(Makefile)
116
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
118
echo " * Installation prefix: $prefix"
119
echo " * System type: $host_vendor-$host_os"
120
echo " * Host CPU: $host_cpu"
121
echo " * C Compiler: $CC_VERSION"
122
echo " * C++ Compiler: $CXX_VERSION"
123
echo " * Debug enabled: $with_debug"
124
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
125
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
126
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
127
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
128
echo " * C++ shared_ptr namespace: $ac_cv_shared_ptr_namespace"
134
def write_external_makefile(plugin, plugin_file):
136
plugin_file.write("""
137
ACLOCAL_AMFLAGS = -I m4 --force
138
VERSION=$(PANDORA_RELEASE_VERSION)
140
pkgplugindir=%(pkgplugindir)s
141
EXTRA_DIST = plugin.ini
144
if plugin['headers'] != "":
145
plugin_file.write("noinst_HEADERS = %(headers)s\n" % plugin)
146
if plugin['testsuite']:
147
if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "":
148
plugin_file.write("EXTRA_DIST += %(testsuitedir)s\n" % plugin)
149
plugin_file.write("""
150
pkgplugin_LTLIBRARIES=%(pname)s.la
151
%(pname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
152
%(pname)s_la_LIBADD=%(libs)s
153
%(pname)s_la_DEPENDENCIES=%(libs)s
154
%(pname)s_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
155
%(pname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
156
%(pname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
158
%(pname)s_la_SOURCES=%(sources)s
161
plugin_am_file=os.path.join(plugin['rel_path'],'plugin.am')
162
if os.path.exists(plugin_am_file):
163
plugin_file.write('include %s\n' % plugin_am_file)
165
64
def write_external_plugin():
166
65
"""Return True if the plugin had changed."""
167
66
plugin = read_plugin_ini('.')
168
67
expand_plugin_ini(plugin, '.')
169
plugin_file = ChangeProtectedFile('configure.ac')
170
write_external_configure(plugin, plugin_file)
68
plugin_file = ChangeProtectedFile('pandora-plugin.ac')
69
write_plugin_ac(plugin, plugin_file)
171
70
result = plugin_file.close()
172
plugin_file = ChangeProtectedFile('Makefile.am')
173
write_external_makefile(plugin, plugin_file)
71
plugin_file = ChangeProtectedFile('pandora-plugin.am')
72
write_plugin_am(plugin, plugin_file)
174
73
# Write some stub configure.ac and Makefile.am files that include the above
175
74
result = plugin_file.close() or result
193
97
for m4_file in os.listdir(plugin_m4_dir):
194
98
if os.path.splitext(m4_file)[-1] == '.m4':
195
99
plugin_m4_files.append(os.path.join(plugin['rel_path'], m4_file))
100
plugin_ac.write("""dnl Generated file, run make to rebuild
197
101
dnl Config for %(title)s
199
103
for m4_file in plugin_m4_files:
200
104
plugin_ac.write('m4_sinclude([%s])\n' % m4_file)
201
plugin['plugin_dep_libs']=" ".join(["\${top_builddir}/%s" % f for f in plugin['libs'].split()])
205
dnl This plugin is staticly built, which means we cannot live without and it is not
206
dnl possible to disable it. Once it is disableable, we will make it non-static.
207
with_%(name)s_plugin=yes
208
pandora_builtin_list="_drizzled_%(name)s_plugin_,${pandora_builtin_list}"
209
pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(pname)s.la"
210
PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} %(plugin_dep_libs)s"
213
if plugin['testsuite']:
215
pandora_plugin_test_list="%(name)s,${pandora_plugin_test_list}"
219
107
AC_ARG_WITH([%(name_with_dashes)s-plugin],[
220
dnl indented wierd to make the help output correct
221
AS_HELP_STRING([--with-%(name_with_dashes)s-plugin],[Build %(title)s. @<:@default=%(enabled)s@:>@])
108
dnl indented werid to make the help output correct
109
AS_HELP_STRING([--with-%(name_with_dashes)s-plugin],[Build %(title)s and enable it. @<:@default=%(default_yesno)s@:>@])
222
110
AS_HELP_STRING([--without-%(name_with_dashes)s-plugin],[Disable building %(title)s])
224
with_%(name)s_plugin="$withval"
225
AS_IF([test "x$with_%(name)s_plugin" = "xyes"],[
226
requested_%(name)s_plugin="yes"
228
requested_%(name)s_plugin="no"
231
with_%(name)s_plugin="%(enabled)s"
232
requested_%(name)s_plugin="no"
234
AC_ARG_ENABLE([%(name_with_dashes)s-plugin],[
235
dnl indented wierd to make the help output correct
236
AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Build %(title)s. @<:@default=%(default_yesno)s@:>@])
237
AS_HELP_STRING([--disable-%(name_with_dashes)s-plugin],[Disable building %(title)s])
239
[enable_%(name)s_plugin="$withval"],
240
[enable_%(name)s_plugin=%(default_yesno)s])
112
[with_%(name)s_plugin="$withval"],
113
[AS_IF([test "x$ac_with_all_plugins" = "xyes"],
114
[with_%(name)s_plugin=yes],
115
[with_%(name)s_plugin=%(default_yesno)s])])
243
117
if os.path.exists(plugin_ac_file):
244
118
plugin_ac.write('m4_sinclude([%s])\n' % plugin_ac_file)
251
125
plugin_ac.write("""
252
126
AS_IF([test %(build_conditional)s],
253
127
[], dnl build_conditional can only negate
255
AS_IF([test "x${requested_%(name)s_plugin}" = "xyes"],
256
[AC_MSG_ERROR([Plugin %(name)s was explicitly requested, yet failed build dependency checks. Aborting!])])
257
with_%(name)s_plugin=no
261
if not plugin['unconditional']:
128
[with_%(name)s_plugin=no])
130
plugin['plugin_dep_libs']=" ".join(["\${top_builddir}/%s" % f for f in plugin['libs'].split()])
263
132
AM_CONDITIONAL([%(build_conditional_tag)s],
264
133
[test %(build_conditional)s])
266
if not plugin['static']:
268
134
AS_IF([test "x$with_%(name)s_plugin" = "xyes"],
137
if plugin['testsuite'] != "":
139
pandora_plugin_test_list="%(testsuite)s,${pandora_plugin_test_list}"
143
#pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
145
pandora_builtin_list="builtin_%(name)s_plugin,${pandora_builtin_list}"
146
pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/plugin/lib%(name)s_plugin.la"
147
PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} %(plugin_dep_libs)s"
271
if plugin['testsuite']:
273
pandora_plugin_test_list="%(name)s,${pandora_plugin_test_list}"
276
150
plugin_ac.write("""
277
AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[
278
pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
151
pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
281
plugin_ac.write(" ])\n")
153
plugin_ac.write(" ])\n")
284
156
def expand_plugin_ini(plugin, plugin_dir):
285
if plugin['name'] == "**OUT-OF-TREE**":
286
print "Out of tree plugins require the name field to be specified in plugin.ini"
289
if plugin_dir == ".":
290
plugin['rel_path']= plugin_dir
291
plugin['unconditional']=True
293
plugin['rel_path']= plugin_dir[len(top_srcdir)+len(os.path.sep):]
294
plugin['unconditional']=False
157
plugin['rel_path']= plugin_dir[len(top_srcdir)+len(os.path.sep):]
295
158
# TODO: determine path to plugin dir relative to top_srcdir... append it to
296
159
# source files if they don't already have it
297
160
if plugin['sources'] == "":
298
161
plugin['sources']="%s.cc" % plugin['name']
300
if plugin_dir != ".":
301
for src in plugin['sources'].split():
302
if not src.startswith(plugin['rel_path']):
303
src= os.path.join(plugin['rel_path'], src)
304
new_sources= "%s %s" % (new_sources, src)
306
new_sources= " ".join(plugin['sources'].split())
307
if new_sources != "":
308
plugin['sources']= new_sources
309
plugin['main_source']= plugin['sources'].split()[0]
163
for src in plugin['sources'].split():
164
if not src.startswith(plugin['rel_path']):
165
src= os.path.join(plugin['rel_path'], src)
166
new_sources= "%s %s" % (new_sources, src)
167
plugin['sources']= new_sources
312
if plugin_dir != ".":
313
for header in plugin['headers'].split():
314
if not header.startswith(plugin['rel_path']):
315
header= os.path.join(plugin['rel_path'], header)
316
new_headers= "%s %s" % (new_headers, header)
318
new_headers= " ".join(plugin['headers'].split())
319
if new_headers != "":
320
plugin['headers']= new_headers
170
for header in plugin['headers'].split():
171
if not header.startswith(plugin['rel_path']):
172
header= os.path.join(plugin['rel_path'], header)
173
new_headers= "%s %s" % (new_headers, header)
174
plugin['headers']= new_headers
322
176
# Make a yes/no version for autoconf help messages
323
177
if plugin['load_by_default']:
330
184
plugin['name_with_dashes']= plugin['name'].replace('_','-')
331
185
if plugin.has_key('build_conditional'):
332
186
plugin['has_build_conditional']=True
333
plugin['build_conditional']='"x${with_%(name)s_plugin}" = "xyes" -a %(build_conditional)s' % plugin
335
188
plugin['has_build_conditional']=False
336
189
plugin['build_conditional']='"x${with_%(name)s_plugin}" = "xyes"' %plugin
338
if plugin['install']:
339
plugin['library_type']= 'pkgplugin';
341
plugin['library_type']= 'noinst';
343
def find_testsuite(plugin_dir):
344
for testdir in ['drizzle-tests','tests']:
345
if os.path.isdir(os.path.join(plugin_dir,testdir)):
347
if os.path.isdir(os.path.join('tests','suite',os.path.basename(plugin_dir))):
351
192
def read_plugin_ini(plugin_dir):
352
if plugin_dir == ".":
353
plugin_name="**OUT-OF-TREE**"
355
plugin_name=os.path.basename(plugin_dir)
357
193
plugin_file= os.path.join(plugin_dir,plugin_ini_fname)
358
plugin_defaults= dict(sources="",
368
license="PLUGIN_LICENSE_GPL",
370
load_by_default="False",
373
install=default_install)
374
parser=ConfigParser.ConfigParser(defaults= plugin_defaults)
194
parser=ConfigParser.ConfigParser(defaults=dict(sources="",headers="", cflags="",cppflags="",cxxflags="", libs="", ldflags="", testsuite=""))
375
195
parser.read(plugin_file)
376
196
plugin=dict(parser.items('plugin'))
377
if plugin_dir == '.':
378
if not plugin.has_key('url'):
379
print "External Plugins are required to specifiy a url"
380
plugin['url']= 'http://launchpad.net/%(name)s' % plugin
382
if plugin_dir == '.' and not plugin.has_key('version'):
383
print "External Plugins are required to specifiy a version"
385
if not plugin.has_key('version'):
386
plugin['version']=datetime.date.fromtimestamp(time.time()).isoformat()
197
plugin['name']= os.path.basename(plugin_dir)
388
198
if plugin.has_key('load_by_default'):
389
199
plugin['load_by_default']=parser.getboolean('plugin','load_by_default')
390
if plugin.has_key('disabled'):
391
plugin['disabled']=parser.getboolean('plugin','disabled')
392
if plugin['disabled']:
393
plugin['enabled']="no"
395
plugin['enabled']="yes"
201
plugin['load_by_default']=False
396
202
if plugin.has_key('static'):
397
203
plugin['static']= parser.getboolean('plugin','static')
398
if plugin.has_key('install'):
399
plugin['install']= parser.getboolean('plugin','install')
400
if plugin.has_key('testsuite'):
401
if plugin['testsuite'] == 'disable':
402
plugin['testsuite']= False
404
plugin_testsuite= find_testsuite(plugin_dir)
405
plugin['testsuitedir']=plugin_testsuite
406
if plugin_testsuite is not None:
407
plugin['testsuite']=True
409
plugin['testsuite']=False
411
plugin['cflags']+= extra_cflags
412
plugin['cppflags']+= extra_cppflags
413
plugin['cxxflags']+= extra_cxxflags
415
plugin['pname']= "lib%s%s%s" % (plugin_prefix, plugin['name'], plugin_suffix)
416
plugin['root_plugin_dir']= root_plugin_dir
417
plugin['plugin_prefix']= plugin_prefix
418
plugin['plugin_suffix']= plugin_suffix
419
plugin['pkgplugindir']= pkgplugindir
205
plugin['static']= False
430
216
# The .plugin.ini.stamp avoids changing the datestamp on plugin.ini which can
431
217
# confuse VCS systems.
433
EXTRA_DIST += %(rel_path)s/plugin.ini
218
plugin_am.write("""## Generated by register_plugins.py
219
EXTRA_DIST += %(rel_path)s/pandora-plugin.ac
221
${top_srcdir}/%(rel_path)s/pandora-plugin.am: ${top_srcdir}/config/register_plugins.py %(rel_path)s/.plugin.ini.stamp
223
${top_srcdir}/%(rel_path)s/pandora-plugin.ac: ${top_srcdir}/config/register_plugins.py %(rel_path)s/.plugin.ini.stamp
225
configure: ${top_srcdir}/%(rel_path)s/pandora-plugin.ac
435
227
# Prevent errors when a plugin dir is removed
436
228
%(rel_path)s/plugin.ini:
230
# Failures to update the plugin.ini are ignored to permit plugins to be deleted
232
%(rel_path)s/.plugin.ini.stamp: %(rel_path)s/plugin.ini
233
@if [ ! -e ${top_srcdir}/%(rel_path)s/plugin.ini ]; then \\
234
echo "%(rel_path)s/plugin.ini is missing"; \\
237
if [ $$? -ne 0 ]; then \\
238
echo 'cd ${srcdir} && python config/register_plugins.py ${top_srcdir} ${top_builddir} %(rel_path)s'; \\
239
unchanged=`cd ${srcdir} && python config/register_plugins.py ${top_srcdir} ${top_builddir} %(rel_path)s` ;\\
240
if [ $$? -ne 0 ]; then \\
241
echo "**** register_plugins failed ****"; \\
244
for plugin_dir in $$unchanged; do \\
245
echo "plugin $$plugin_dir unchanged." ; \\
246
touch -f -r $$plugin_dir/pandora-plugin.am $$plugin_dir/.plugin.ini.stamp; \\
248
cp $< $@ || echo "Failed to update $@"; \\
439
252
if plugin['headers'] != "":
440
253
plugin_am.write("noinst_HEADERS += %(headers)s\n" % plugin)
441
if plugin['testsuite']:
442
if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "":
443
plugin_am.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin)
444
254
if plugin['static']:
445
255
plugin_am.write("""
446
%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
256
plugin_lib%(name)s_dir=${top_srcdir}/%(rel_path)s
447
257
EXTRA_DIST += %(rel_path)s/plugin.ini
448
258
if %(build_conditional_tag)s
449
noinst_LTLIBRARIES+=%(root_plugin_dir)s/%(pname)s.la
450
%(root_plugin_dir)s_%(pname)s_la_LIBADD=%(libs)s
451
%(root_plugin_dir)s_%(pname)s_la_DEPENDENCIES=%(libs)s
452
%(root_plugin_dir)s_%(pname)s_la_LDFLAGS=$(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
453
%(root_plugin_dir)s_%(pname)s_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
454
%(root_plugin_dir)s_%(pname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
455
%(root_plugin_dir)s_%(pname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
259
noinst_LTLIBRARIES+=plugin/lib%(name)s_plugin.la
260
plugin_lib%(name)s_plugin_la_LIBADD=%(libs)s
261
plugin_lib%(name)s_plugin_la_DEPENDENCIES=%(libs)s
262
plugin_lib%(name)s_plugin_la_LDFLAGS=$(AM_LDFLAGS) %(ldflags)s
263
plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_MODULE_NAME=%(name)s %(cppflags)s
264
plugin_lib%(name)s_plugin_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
265
plugin_lib%(name)s_plugin_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
457
%(root_plugin_dir)s_%(pname)s_la_SOURCES=%(sources)s
458
PANDORA_DYNAMIC_LDADDS+=${top_builddir}/%(root_plugin_dir)s/%(pname)s.la
267
plugin_lib%(name)s_plugin_la_SOURCES=%(sources)s
268
PANDORA_DYNAMIC_LDADDS+=${top_builddir}/plugin/lib%(name)s_plugin.la
462
272
plugin_am.write("""
463
%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
273
plugin_lib%(name)s_dir=${top_srcdir}/%(rel_path)s
464
274
EXTRA_DIST += %(rel_path)s/plugin.ini
465
275
if %(build_conditional_tag)s
466
%(library_type)s_LTLIBRARIES+=%(root_plugin_dir)s/%(pname)s.la
467
%(root_plugin_dir)s_%(pname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
468
%(root_plugin_dir)s_%(pname)s_la_LIBADD=%(libs)s
469
%(root_plugin_dir)s_%(pname)s_la_DEPENDENCIES=%(libs)s
470
%(root_plugin_dir)s_%(pname)s_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
471
%(root_plugin_dir)s_%(pname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
472
%(root_plugin_dir)s_%(pname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
276
pkgplugin_LTLIBRARIES+=plugin/lib%(name)s_plugin.la
277
plugin_lib%(name)s_plugin_la_LDFLAGS=-module -avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s
278
plugin_lib%(name)s_plugin_la_LIBADD=%(libs)s
279
plugin_lib%(name)s_plugin_la_DEPENDENCIES=%(libs)s
280
plugin_lib%(name)s_plugin_la_CPPFLAGS=$(AM_CPPFLAGS) -DPANDORA_DYNAMIC_PLUGIN -DPANDORA_MODULE_NAME=%(name)s %(cppflags)s
281
plugin_lib%(name)s_plugin_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s
282
plugin_lib%(name)s_plugin_la_CFLAGS=$(AM_CFLAGS) %(cflags)s
474
%(root_plugin_dir)s_%(pname)s_la_SOURCES=%(sources)s
284
plugin_lib%(name)s_plugin_la_SOURCES=%(sources)s
477
287
plugin_am_file=os.path.join(plugin['rel_path'],'plugin.am')
478
288
if os.path.exists(plugin_am_file):
479
289
plugin_am.write('include %s\n' % plugin_am_file)
485
if arg.startswith('--top_srcdir='):
487
elif arg.startswith('--top_builddir='):
488
top_builddir=arg[14:]
489
elif arg == "--force-all":
490
actions=['plugin-list','pandora-plugin.am','write']
293
top_srcdir=sys.argv[1]
294
top_builddir=sys.argv[2]
296
if not os.path.exists("config/plugin.list"):
297
os.system("find plugin -name 'plugin.ini' | xargs -n1 dirname | xargs -n1 basename | sort -b -d > .plugin.scan")
298
os.system("cp .plugin.scan config/plugin.list")
303
plugin_list = [top_srcdir + '/' + plugin_name for plugin_name in sys.argv[3:]]
494
if len(actions) == 0:
495
actions.append('write')
497
def accumulate_plugins(arg, dirname, fnames):
498
# plugin_ini_fname is a name in dirname indicating dirname is a plugin.
499
if plugin_ini_fname in fnames:
501
os.path.walk(os.path.join(top_srcdir,root_plugin_dir),accumulate_plugins,plugin_list)
504
if not os.path.exists("config/pandora-plugin.am") or "write" in actions:
505
plugin_am_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.am'))
506
plugin_am_file.write("""
507
# always the current list, generated every build so keep this lean.
508
# pandora-plugin.list: datestamp preserved list
509
${srcdir}/config/pandora-plugin.list: .plugin.scan
511
@cd ${top_srcdir} && python config/pandora-plugin plugin-list
513
# Plugins affect configure; so to prevent configure running twice in a tarball
514
# build (once up front, once with the right list of plugins, we ship the
515
# generated list of plugins and the housekeeping material for that list so it
516
# is likewise not updated.
518
config/pandora-plugin.am \
519
config/pandora-plugin.ac \
520
config/pandora-plugin
523
# Seed the list of plugin LDADDS which plugins may extend.
524
PANDORA_DYNAMIC_LDADDS=
526
# plugin.stamp: graph dominator for creating all per pandora-plugin.ac/am
527
# files. This is invoked when the code to generate such files has altered.""")
529
if not os.path.exists("config/pandora-plugin.ac") or "write" in actions:
530
plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac'))
531
plugin_ac_file.write("dnl Generated file, run make to rebuild\n")
305
def accumulate_plugins(arg, dirname, fnames):
306
# plugin_ini_fname is a name in dirname indicating dirname is a plugin.
307
if plugin_ini_fname in fnames:
309
os.path.walk(os.path.join(top_srcdir,"plugin"),accumulate_plugins,plugin_list)
534
311
if os.path.exists('plugin.ini'):
535
312
# Are we in a plugin dir which wants to have a self-sufficient build system?
538
313
write_external_plugin()
540
plugin_list_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.list'))
541
for p in plugin_list:
542
plugin_list_file.write(p)
543
plugin_list_file.write("\n")
544
315
plugin_list.sort()
545
plugin_list_file.close()
547
if not os.path.exists("config/pandora-plugin.am") or 'write' in actions:
548
plugin_am_file.write("\n${top_srcdir}/config/pandora-plugin.am: ${top_srcdir}/config/pandora-plugin.list ${top_srcdir}/config/pandora-plugin ")
549
for plugin_dir in plugin_list:
550
plugin_am_file.write("\\\n\t%s/plugin.ini " % plugin_dir)
551
plugin_am_file.write("\n\tcd ${top_srcdir} && python config/pandora-plugin write\n")
552
for plugin_dir in plugin_list:
553
write_plugin(plugin_dir)
555
if plugin_am_file is not None:
556
plugin_am_file.close()
557
if plugin_ac_file is not None:
558
plugin_ac_file.close()
316
for plugin_dir in plugin_list:
317
if not write_plugin(plugin_dir):
320
if not os.path.exists("config/plugin-list.am"):
321
os.system(r"sed 's,^\(.*\)$,include plugin/\1/pandora-plugin.am,' < config/plugin.list > config/plugin-list.am")
323
if not os.path.exists("config/plugin-list.ac"):
324
os.system(r"sed 's,^\(.*\)$,m4_sinclude(plugin/\1/pandora-plugin.ac),' < config/plugin.list > config/plugin-list.ac")