Merge lp:~mordred/drizzle/pandora-static-build into lp:drizzle/7.0

Proposed by Monty Taylor
Status: Merged
Approved by: Lee Bieber
Approved revision: 2095
Merged at revision: 2096
Proposed branch: lp:~mordred/drizzle/pandora-static-build
Merge into: lp:drizzle/7.0
Diff against target: 181 lines (+50/-19)
3 files modified
config/pandora-plugin (+47/-18)
m4/pandora_warnings.m4 (+2/-0)
plugin/innobase/plugin.am (+1/-1)
To merge this branch: bzr merge lp:~mordred/drizzle/pandora-static-build
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+46369@code.launchpad.net

Description of the change

Adds --with-all-static and --with-static-*-plugin

To post a comment you must log in.
Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote :

Brian had to back this out, will try merging it again by itself

2094. By Monty Taylor

Adds ability to build plugins static.

Revision history for this message
Monty Taylor (mordred) wrote :

Ok. I just rebased it on top of the backout patch (so that it'll actually do something when you try to merge it back in)

I'm pretty sure the valgrind warnings came from the other branch. In a normal world, this one does nothing to anything... but I'll look in to it.

2095. By Monty Taylor

Make sure we distribute all the source files, even if configure didn't find
optional libraries.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config/pandora-plugin'
2--- config/pandora-plugin 2011-01-17 21:33:14 +0000
3+++ config/pandora-plugin 2011-01-18 18:32:13 +0000
4@@ -1,6 +1,7 @@
5 #!/usr/bin/python
6
7 # Copyright (C) 2009 Sun Microsystems, Inc.
8+# Copyright (C) 2010, 2011 Monty Taylor
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12@@ -243,6 +244,19 @@
13 with_%(name)s_plugin="%(enabled)s"
14 requested_%(name)s_plugin="no"
15 ])
16+AC_ARG_WITH([static-%(name_with_dashes)s-plugin],[
17+AS_HELP_STRING([--with-static-%(name_with_dashes)s-plugin],[Build Archive Storage Engine. @<:@default=%(static_yesno)s@:>@])
18+AS_HELP_STRING([--without-static-%(name_with_dashes)s-plugin],[Disable building Archive Storage Engine])
19+ ],[
20+ with_static_%(name)s_plugin=${withval}
21+ ],[
22+ with_static_%(name)s_plugin=%(static_yesno)s
23+])
24+AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[
25+ shared_%(name)s_plugin=no
26+ ],[
27+ shared_%(name)s_plugin=yes
28+])
29 AC_ARG_ENABLE([%(name_with_dashes)s-plugin],[
30 dnl indented wierd to make the help output correct
31 AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Enable loading %(title)s by default. @<:@default=%(default_yesno)s@:>@])
32@@ -272,20 +286,24 @@
33 """ % plugin)
34 if not plugin['unconditional']:
35 plugin_ac.write("""
36+AM_CONDITIONAL([%(static_build_conditional_tag)s],
37+ [test %(build_conditional)s -a ! %(shared_build)s])
38+AM_CONDITIONAL([%(shared_build_conditional_tag)s],
39+ [test %(build_conditional)s -a %(shared_build)s])
40 AM_CONDITIONAL([%(build_conditional_tag)s],
41 [test %(build_conditional)s])
42 """ % plugin)
43
44 plugin_ac.write("""
45-AS_IF([test "x$with_%(name)s_plugin" = "xyes"],
46- [
47+AS_IF([test "x$with_%(name)s_plugin" = "xyes"],[
48 """ % plugin)
49 if plugin['testsuite']:
50 plugin_ac.write("""
51 pandora_plugin_test_list="%(name)s,${pandora_plugin_test_list}"
52 """ % plugin)
53- if plugin['static']:
54- plugin_ac.write("""
55+ plugin_ac.write("""
56+ AS_IF([test "x${with_static_%(name)s_plugin}" = "xyes" -o "x${with_all_static}" = "xyes"],[
57+
58 AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[
59 pandora_builtin_load_list="%(module_name)s,${pandora_builtin_load_list}"
60 pandora_builtin_load_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_load_symbols_list}"
61@@ -294,15 +312,13 @@
62 pandora_builtin_list="%(module_name)s,${pandora_builtin_list}"
63 pandora_builtin_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_symbols_list}"
64 pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(libname)s.la"
65- """ % plugin)
66-
67- else:
68- plugin_ac.write("""
69+ ],[
70 AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[
71 pandora_default_plugin_list="%(name)s,${pandora_default_plugin_list}"
72 ])
73+ ])
74 """ % plugin)
75- plugin_ac.write(" ])\n")
76+ plugin_ac.write("])\n")
77
78 def fix_file_paths(plugin, files):
79 # TODO: determine path to plugin dir relative to top_srcdir... append it to
80@@ -347,7 +363,13 @@
81 plugin['extra_dist']=" ".join([os.path.join(plugin['rel_path'],f) for f in plugin['extra_dist'].split()])
82
83
84+ if plugin['static']:
85+ plugin['static_yesno']="yes"
86+ else:
87+ plugin['static_yesno']="no"
88 plugin['build_conditional_tag']= "BUILD_%s_PLUGIN" % plugin['name'].upper()
89+ plugin['shared_build_conditional_tag']= "BUILD_%s_PLUGIN_SHARED" % plugin['name'].upper()
90+ plugin['static_build_conditional_tag']= "BUILD_%s_PLUGIN_STATIC" % plugin['name'].upper()
91 plugin['name_with_dashes']= plugin['name'].replace('_','-')
92 if plugin.has_key('build_conditional'):
93 plugin['has_build_conditional']=True
94@@ -355,6 +377,7 @@
95 else:
96 plugin['has_build_conditional']=False
97 plugin['build_conditional']='"x${with_%(name)s_plugin}" = "xyes"' %plugin
98+ plugin['shared_build']='"x${shared_%(name)s_plugin}" = "xyes"' %plugin
99
100 if plugin['install']:
101 plugin['library_type']= 'pkgplugin'
102@@ -518,11 +541,12 @@
103 plugin_am.write("EXTRA_DIST += %(rel_path)s/%(dist_testsuite)s\n" % plugin)
104 if plugin['docs'] is not None:
105 plugin_am.write("EXTRA_DIST += ${top_srcdir}/%(rel_path)s/docs/*.rst\n" % plugin)
106- if plugin['static']:
107- plugin_am.write("""
108+ plugin_am.write("""
109 %(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
110-EXTRA_DIST += %(rel_path)s/plugin.ini
111-if %(build_conditional_tag)s
112+# Include sources in EXTRA_DIST because we might not build this, but we
113+# still want the sources to wind up in a tarball
114+EXTRA_DIST += %(rel_path)s/plugin.ini %(sources)s
115+if %(static_build_conditional_tag)s
116 noinst_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la
117 %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s
118 %(root_plugin_dir)s_%(libname)s_la_DEPENDENCIES=%(libs)s
119@@ -534,12 +558,8 @@
120 check_PROGRAMS += %(tests)s
121 PANDORA_DYNAMIC_LDADDS+=${top_builddir}/%(root_plugin_dir)s/%(libname)s.la
122 endif
123-""" % plugin)
124- else:
125- plugin_am.write("""
126-%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
127 EXTRA_DIST += %(rel_path)s/plugin.ini
128-if %(build_conditional_tag)s
129+if %(shared_build_conditional_tag)s
130 %(library_type)s_LTLIBRARIES+=%(root_plugin_dir)s/%(libname)s.la
131 %(root_plugin_dir)s_%(libname)s_la_LDFLAGS=-avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
132 %(root_plugin_dir)s_%(libname)s_la_LIBADD=%(libs)s
133@@ -662,6 +682,15 @@
134 if not os.path.exists("config/pandora-plugin.ac") or "write" in actions:
135 plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac'))
136 plugin_ac_file.write("dnl Generated file, run make to rebuild\n")
137+ plugin_ac_file.write("""
138+AC_ARG_WITH([all-static],[
139+AS_HELP_STRING([--with-all-static],[Link all plugins staticly into the server @<:@default=no@:>@])
140+],[
141+ with_all_static="$withval"
142+ ],[
143+ with_all_static=no
144+])
145+ """)
146
147 if os.path.exists("docs/plugins"):
148 if not os.path.exists("docs/plugins/list.rst") or "write" in actions:
149
150=== modified file 'm4/pandora_warnings.m4'
151--- m4/pandora_warnings.m4 2011-01-17 21:33:14 +0000
152+++ m4/pandora_warnings.m4 2011-01-18 18:32:13 +0000
153@@ -372,6 +372,7 @@
154 PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
155 NO_WERROR="-Wno-error"
156 PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
157+ PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
158 AS_IF([test "$host_vendor" = "apple"],[
159 BOOSTSKIP_WARNINGS="-Wno-uninitialized"
160 ])
161@@ -434,6 +435,7 @@
162 AC_SUBST(INNOBASE_SKIP_WARNINGS)
163 AC_SUBST(BOOSTSKIP_WARNINGS)
164 AC_SUBST(PERMISSIVE_WARNINGS)
165+ AC_SUBST(PERMISSIVE_C_WARNINGS)
166 AC_SUBST(NO_WERROR)
167 AC_SUBST([GCOV_LIBS])
168
169
170=== modified file 'plugin/innobase/plugin.am'
171--- plugin/innobase/plugin.am 2011-01-17 21:33:14 +0000
172+++ plugin/innobase/plugin.am 2011-01-18 18:32:13 +0000
173@@ -320,7 +320,7 @@
174 # and unused/undefeind stuf, but are generated anyway
175 plugin_innobase_libpars_la_CFLAGS= \
176 ${AM_CFLAGS} \
177- ${PERMISSIVE_WARNINGS} \
178+ ${PERMISSIVE_C_WARNINGS} \
179 -DUNIV_NONINL \
180 -I$(top_builddir)/plugin/innobase/include \
181 -I$(top_srcdir)/plugin/innobase/include \

Subscribers

People subscribed via source and target branches