X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=config%2Fpandora-plugin;h=936dbd32f8e98300c9d0754c54fb1ae2f03b5f15;hb=fc21f9b9bc7d55fc4ce9d7a323b9e9173dbbe3ba;hp=91302914c3c1c40fbb251ceae52d40ed809f5e33;hpb=db67ec92f832b5cf51c1b8bff3d843549b97dac7;p=m6w6%2Flibmemcached diff --git a/config/pandora-plugin b/config/pandora-plugin index 91302914..936dbd32 100755 --- a/config/pandora-plugin +++ b/config/pandora-plugin @@ -1,6 +1,7 @@ #!/usr/bin/python # Copyright (C) 2009 Sun Microsystems, Inc. +# Copyright (C) 2010, 2011 Monty Taylor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -133,6 +134,7 @@ EXTRA_DIST = plugin.ini noinst_HEADERS= nobase_include_HEADERS= +nobase_pkginclude_HEADERS= check_PROGRAMS= noinst_LTLIBRARIES= bin_PROGRAMS= @@ -142,7 +144,7 @@ bin_PROGRAMS= if plugin['headers'] != "": plugin_file.write("noinst_HEADERS += %(headers)s\n" % plugin) if plugin['install_headers'] != "": - plugin_file.write("nobase_include_HEADERS += %(install_headers)s\n" % plugin) + plugin_file.write("nobase_pkginclude_HEADERS += %(install_headers)s\n" % plugin) if plugin['testsuite']: if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "": plugin_file.write("EXTRA_DIST += %(testsuitedir)s\n" % plugin) @@ -151,7 +153,7 @@ pkgplugin_LTLIBRARIES=%(libname)s.la %(libname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS) %(libname)s_la_LIBADD=%(libs)s %(libname)s_la_DEPENDENCIES=%(libs)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 %(cppflags)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 %(cppflags)s %(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s %(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s %(libname)s_la_SOURCES=%(sources)s @@ -199,15 +201,18 @@ def write_plugin(plugin, plugin_ini_list): write_plugin_ac(plugin, plugin_ac_file) write_plugin_am(plugin, plugin_am_file) - write_plugin_docs(plugin, plugin_doc_index) + write_plugin_docs(plugin, plugin_doc_index, plugin_am_file) plugin['writing_status'] = 'done' -def write_plugin_docs(plugin, doc_index): +def write_plugin_docs(plugin, doc_index, plugin_am): if plugin['docs'] is not None and os.path.isdir("docs/plugins"): if not os.path.exists(os.path.join("docs/plugins",plugin["name"])): os.symlink(os.path.abspath(plugin["docs"]), os.path.join("docs/plugins",plugin["name"])) doc_index.write(""" %(name)s/index""" % plugin) + plugin_am.write(""" +EXTRA_DIST+=${top_srcdir}/docs/plugins/%(name)s/*.rst +""" % plugin) def write_plugin_ac(plugin, plugin_ac): # @@ -243,6 +248,19 @@ AS_HELP_STRING([--without-%(name_with_dashes)s-plugin],[Disable building %(title with_%(name)s_plugin="%(enabled)s" requested_%(name)s_plugin="no" ]) +AC_ARG_WITH([static-%(name_with_dashes)s-plugin],[ +AS_HELP_STRING([--with-static-%(name_with_dashes)s-plugin],[Build Archive Storage Engine. @<:@default=%(static_yesno)s@:>@]) +AS_HELP_STRING([--without-static-%(name_with_dashes)s-plugin],[Disable building Archive Storage Engine]) + ],[ + with_static_%(name)s_plugin=${withval} + ],[ + with_static_%(name)s_plugin=%(static_yesno)s +]) +AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[ + shared_%(name)s_plugin=no + ],[ + shared_%(name)s_plugin=yes +]) AC_ARG_ENABLE([%(name_with_dashes)s-plugin],[ dnl indented wierd to make the help output correct AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Enable loading %(title)s by default. @<:@default=%(default_yesno)s@:>@]) @@ -272,20 +290,24 @@ AS_IF([test %(build_conditional)s], """ % plugin) if not plugin['unconditional']: plugin_ac.write(""" +AM_CONDITIONAL([%(static_build_conditional_tag)s], + [test %(build_conditional)s -a ! %(shared_build)s]) +AM_CONDITIONAL([%(shared_build_conditional_tag)s], + [test %(build_conditional)s -a %(shared_build)s]) AM_CONDITIONAL([%(build_conditional_tag)s], [test %(build_conditional)s]) """ % plugin) plugin_ac.write(""" -AS_IF([test "x$with_%(name)s_plugin" = "xyes"], - [ +AS_IF([test "x$with_%(name)s_plugin" = "xyes"],[ """ % plugin) if plugin['testsuite']: plugin_ac.write(""" pandora_plugin_test_list="%(name)s,${pandora_plugin_test_list}" """ % plugin) - if plugin['static']: - plugin_ac.write(""" + plugin_ac.write(""" + AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[ + AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[ pandora_builtin_load_list="%(module_name)s,${pandora_builtin_load_list}" pandora_builtin_load_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_load_symbols_list}" @@ -294,15 +316,13 @@ AS_IF([test "x$with_%(name)s_plugin" = "xyes"], pandora_builtin_list="%(module_name)s,${pandora_builtin_list}" pandora_builtin_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_symbols_list}" pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(libname)s.la" - """ % plugin) - - else: - plugin_ac.write(""" + ],[ AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[ pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}" ]) + ]) """ % plugin) - plugin_ac.write(" ])\n") + plugin_ac.write("])\n") def fix_file_paths(plugin, files): # TODO: determine path to plugin dir relative to top_srcdir... append it to @@ -347,7 +367,13 @@ def expand_plugin_ini(plugin): plugin['extra_dist']=" ".join([os.path.join(plugin['rel_path'],f) for f in plugin['extra_dist'].split()]) + if plugin['static']: + plugin['static_yesno']="yes" + else: + plugin['static_yesno']="no" plugin['build_conditional_tag']= "BUILD_%s_PLUGIN" % plugin['name'].upper() + plugin['shared_build_conditional_tag']= "BUILD_%s_PLUGIN_SHARED" % plugin['name'].upper() + plugin['static_build_conditional_tag']= "BUILD_%s_PLUGIN_STATIC" % plugin['name'].upper() plugin['name_with_dashes']= plugin['name'].replace('_','-') if plugin.has_key('build_conditional'): plugin['has_build_conditional']=True @@ -355,6 +381,7 @@ def expand_plugin_ini(plugin): else: plugin['has_build_conditional']=False plugin['build_conditional']='"x${with_%(name)s_plugin}" = "xyes"' %plugin + plugin['shared_build']='"x${shared_%(name)s_plugin}" = "xyes"' %plugin if plugin['install']: plugin['library_type']= 'pkgplugin' @@ -510,7 +537,7 @@ EXTRA_DIST += %(rel_path)s/plugin.ini if plugin['headers'] != "": plugin_am.write("noinst_HEADERS += %(headers)s\n" % plugin) if plugin['install_headers'] != "": - plugin_am.write("nobase_include_HEADERS += %(install_headers)s\n" % plugin) + plugin_am.write("nobase_pkginclude_HEADERS += %(install_headers)s\n" % plugin) if plugin['testsuite']: if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "": plugin_am.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin) @@ -518,33 +545,30 @@ EXTRA_DIST += %(rel_path)s/plugin.ini plugin_am.write("EXTRA_DIST += %(rel_path)s/%(dist_testsuite)s\n" % plugin) if plugin['docs'] is not None: plugin_am.write("EXTRA_DIST += ${top_srcdir}/%(rel_path)s/docs/*.rst\n" % plugin) - if plugin['static']: - plugin_am.write(""" + plugin_am.write(""" %(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s -EXTRA_DIST += %(rel_path)s/plugin.ini -if %(build_conditional_tag)s +# Include sources in EXTRA_DIST because we might not build this, but we +# still want the sources to wind up in a tarball +EXTRA_DIST += %(rel_path)s/plugin.ini %(sources)s +if %(static_build_conditional_tag)s noinst_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s %(root_plugin_dir)s_%(libname)s_la_DEPENDENCIES=%(libs)s %(root_plugin_dir)s_%(libname)s_la_LDFLAGS=$(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS) - %(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 + %(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 %(root_plugin_dir)s_%(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s %(root_plugin_dir)s_%(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s %(root_plugin_dir)s_%(libname)s_la_SOURCES=%(sources)s check_PROGRAMS += %(tests)s PANDORA_DYNAMIC_LDADDS+=${top_builddir}/%(root_plugin_dir)s/%(libname)s.la endif -""" % plugin) - else: - plugin_am.write(""" -%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s EXTRA_DIST += %(rel_path)s/plugin.ini -if %(build_conditional_tag)s +if %(shared_build_conditional_tag)s %(library_type)s_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la %(root_plugin_dir)s_%(libname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS) %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s %(root_plugin_dir)s_%(libname)s_la_DEPENDENCIES=%(libs)s - %(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 + %(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 %(root_plugin_dir)s_%(libname)s_la_CXXFLAGS=$(AM_CXXFLAGS) %(cxxflags)s %(root_plugin_dir)s_%(libname)s_la_CFLAGS=$(AM_CFLAGS) %(cflags)s %(root_plugin_dir)s_%(libname)s_la_SOURCES=%(sources)s @@ -662,6 +686,15 @@ PANDORA_DYNAMIC_LDADDS= if not os.path.exists("config/pandora-plugin.ac") or "write" in actions: plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac')) plugin_ac_file.write("dnl Generated file, run make to rebuild\n") + plugin_ac_file.write(""" +AC_ARG_WITH([all-static],[ +AS_HELP_STRING([--with-all-static],[Link all plugins staticly into the server @<:@default=no@:>@]) +],[ + with_all_static="$withval" + ],[ + with_all_static=no +]) + """) if os.path.exists("docs/plugins"): if not os.path.exists("docs/plugins/list.rst") or "write" in actions: