~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/plugins.m4

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:13:01 UTC
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812211301-ym3wsowelkgp16s2
renamed all instances of MYSQL_ to DRIZZLE_

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
dnl Framework for pluggable static and dynamic plugins for mysql
8
8
dnl
9
9
dnl ---------------------------------------------------------------------------
10
 
dnl Macro: MYSQL_PLUGIN
 
10
dnl Macro: DRIZZLE_PLUGIN
11
11
dnl
12
12
dnl SYNOPSIS
13
 
dnl   MYSQL_PLUGIN([name],[Plugin name],
 
13
dnl   DRIZZLE_PLUGIN([name],[Plugin name],
14
14
dnl                [Plugin description],
15
15
dnl                [group,group...])
16
16
dnl   
20
20
dnl
21
21
dnl ---------------------------------------------------------------------------
22
22
 
23
 
AC_DEFUN([MYSQL_PLUGIN],[
24
 
 _MYSQL_PLUGIN(
 
23
AC_DEFUN([DRIZZLE_PLUGIN],[
 
24
 _DRIZZLE_PLUGIN(
25
25
  [$1],
26
 
  [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__],
 
26
  [__DRIZZLE_PLUGIN_]AS_TR_CPP([$1])[__],
27
27
  m4_default([$2], [$1 plugin]),
28
28
  m4_default([$3], [plugin for $1]),
29
29
  m4_default([$4], []),
30
30
 )
31
31
])
32
32
 
33
 
AC_DEFUN([_MYSQL_PLUGIN],[
 
33
AC_DEFUN([_DRIZZLE_PLUGIN],[
34
34
 m4_ifdef([$2], [
35
 
  AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3])
 
35
  AC_FATAL([Duplicate DRIZZLE_PLUGIN declaration for $3])
36
36
 ],[
37
37
  m4_define([$2], [$1])
38
 
  _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1])
39
 
  m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
40
 
  m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
41
 
  _MYSQL_PLUGAPPEND_META([$1], $5)
 
38
  _DRIZZLE_PLUGAPPEND([__mysql_plugin_list__],[$1])
 
39
  m4_define([DRIZZLE_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
 
40
  m4_define([DRIZZLE_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
 
41
  _DRIZZLE_PLUGAPPEND_META([$1], $5)
42
42
  ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[
43
 
     MYSQL_PLUGIN_DIRECTORY([$1],
 
43
     DRIZZLE_PLUGIN_DIRECTORY([$1],
44
44
         m4_bregexp(__mysql_include__,[^\(.*\)/plug\.in$],[\1]))
45
45
  ])
46
46
 ])
48
48
 
49
49
 
50
50
dnl ---------------------------------------------------------------------------
51
 
dnl Macro: MYSQL_STORAGE_ENGINE
 
51
dnl Macro: DRIZZLE_STORAGE_ENGINE
52
52
dnl
53
53
dnl SYNOPSIS
54
 
dnl   MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name],
 
54
dnl   DRIZZLE_STORAGE_ENGINE([name],[legacy-option],[Storage engine name],
55
55
dnl                        [Storage engine description],[group,group...])
56
56
dnl
57
57
dnl DESCRIPTION
59
59
dnl
60
60
dnl ---------------------------------------------------------------------------
61
61
 
62
 
AC_DEFUN([MYSQL_STORAGE_ENGINE],[
63
 
 MYSQL_PLUGIN([$1], [$3], [$4], [[$5]])
64
 
 MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
 
62
AC_DEFUN([DRIZZLE_STORAGE_ENGINE],[
 
63
 DRIZZLE_PLUGIN([$1], [$3], [$4], [[$5]])
 
64
 DRIZZLE_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
65
65
 ifelse([$2],[no],[],[
66
 
  _MYSQL_LEGACY_STORAGE_ENGINE(
 
66
  _DRIZZLE_LEGACY_STORAGE_ENGINE(
67
67
      m4_bpatsubst([$1], -, _),
68
68
      m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _))
69
69
 ])
70
70
])
71
71
 
72
 
AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[
 
72
AC_DEFUN([_DRIZZLE_LEGACY_STORAGE_ENGINE],[
73
73
if test "[${with_]$2[+set}]" = set; then
74
74
  [with_plugin_]$1="[$with_]$2"
75
75
fi
77
77
 
78
78
 
79
79
dnl ---------------------------------------------------------------------------
80
 
dnl Macro: MYSQL_PLUGIN_DEFINE
 
80
dnl Macro: DRIZZLE_PLUGIN_DEFINE
81
81
dnl
82
82
dnl SYNOPSIS
83
 
dnl   MYSQL_PLUGIN_DEFINE([name],[MYSQL_CPP_DEFINE])
 
83
dnl   DRIZZLE_PLUGIN_DEFINE([name],[DRIZZLE_CPP_DEFINE])
84
84
dnl
85
85
dnl DESCRIPTION
86
86
dnl   When a plugin is to be statically linked, define the C macro
87
87
dnl
88
88
dnl ---------------------------------------------------------------------------
89
89
 
90
 
AC_DEFUN([MYSQL_PLUGIN_DEFINE],[
91
 
 MYSQL_REQUIRE_PLUGIN([$1])
92
 
 m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2])
 
90
AC_DEFUN([DRIZZLE_PLUGIN_DEFINE],[
 
91
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
92
 m4_define([DRIZZLE_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2])
93
93
])
94
94
 
95
95
 
96
96
dnl ---------------------------------------------------------------------------
97
 
dnl Macro: MYSQL_PLUGIN_DIRECTORY
 
97
dnl Macro: DRIZZLE_PLUGIN_DIRECTORY
98
98
dnl
99
99
dnl SYNOPSIS
100
 
dnl   MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir])
 
100
dnl   DRIZZLE_PLUGIN_DIRECTORY([name],[plugin/dir])
101
101
dnl
102
102
dnl DESCRIPTION
103
103
dnl   Adds a directory to the build process
105
105
dnl
106
106
dnl ---------------------------------------------------------------------------
107
107
 
108
 
AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[
109
 
 MYSQL_REQUIRE_PLUGIN([$1])
110
 
 m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2])
 
108
AC_DEFUN([DRIZZLE_PLUGIN_DIRECTORY],[
 
109
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
110
 m4_define([DRIZZLE_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2])
111
111
])
112
112
 
113
113
 
114
114
dnl ---------------------------------------------------------------------------
115
 
dnl Macro: MYSQL_PLUGIN_STATIC
 
115
dnl Macro: DRIZZLE_PLUGIN_STATIC
116
116
dnl
117
117
dnl SYNOPSIS
118
 
dnl   MYSQL_PLUGIN_STATIC([name],[libmyplugin.a])
 
118
dnl   DRIZZLE_PLUGIN_STATIC([name],[libmyplugin.a])
119
119
dnl
120
120
dnl DESCRIPTION
121
121
dnl   Declare the name for the static library 
122
122
dnl
123
123
dnl ---------------------------------------------------------------------------
124
124
 
125
 
AC_DEFUN([MYSQL_PLUGIN_STATIC],[
126
 
 MYSQL_REQUIRE_PLUGIN([$1])
127
 
 m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
 
125
AC_DEFUN([DRIZZLE_PLUGIN_STATIC],[
 
126
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
127
 m4_define([DRIZZLE_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
128
128
])
129
129
 
130
130
 
131
131
dnl ---------------------------------------------------------------------------
132
 
dnl Macro: MYSQL_PLUGIN_DYNAMIC
 
132
dnl Macro: DRIZZLE_PLUGIN_DYNAMIC
133
133
dnl
134
134
dnl SYNOPSIS
135
 
dnl  MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la])
 
135
dnl  DRIZZLE_PLUGIN_DYNAMIC([name],[myplugin.la])
136
136
dnl
137
137
dnl DESCRIPTION
138
138
dnl   Declare the name for the shared library
139
139
dnl
140
140
dnl ---------------------------------------------------------------------------
141
141
 
142
 
AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[
143
 
 MYSQL_REQUIRE_PLUGIN([$1])
144
 
 m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2])
 
142
AC_DEFUN([DRIZZLE_PLUGIN_DYNAMIC],[
 
143
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
144
 m4_define([DRIZZLE_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2])
145
145
])
146
146
 
147
147
 
148
148
dnl ---------------------------------------------------------------------------
149
 
dnl Macro: MYSQL_PLUGIN_MANDATORY
 
149
dnl Macro: DRIZZLE_PLUGIN_MANDATORY
150
150
dnl
151
151
dnl SYNOPSIS
152
 
dnl   MYSQL_PLUGIN_MANDATORY([name])
 
152
dnl   DRIZZLE_PLUGIN_MANDATORY([name])
153
153
dnl
154
154
dnl DESCRIPTION
155
155
dnl   Marks the specified plugin as a mandatory plugin
156
156
dnl
157
157
dnl ---------------------------------------------------------------------------
158
158
 
159
 
AC_DEFUN([MYSQL_PLUGIN_MANDATORY],[
160
 
 MYSQL_REQUIRE_PLUGIN([$1])
161
 
 _MYSQL_PLUGIN_MANDATORY([$1],
162
 
  [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
163
 
  [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1])
 
159
AC_DEFUN([DRIZZLE_PLUGIN_MANDATORY],[
 
160
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
161
 _DRIZZLE_PLUGIN_MANDATORY([$1],
 
162
  [DRIZZLE_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
 
163
  [DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1])
164
164
 )
165
165
])
166
166
 
167
 
AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[
 
167
AC_DEFUN([_DRIZZLE_PLUGIN_MANDATORY],[
168
168
 m4_define([$2], [yes])
169
169
 m4_ifdef([$3], [
170
170
  AC_FATAL([mandatory plugin $1 has been disabled])
174
174
 
175
175
 
176
176
dnl ---------------------------------------------------------------------------
177
 
dnl Macro: MYSQL_PLUGIN_DISABLED
 
177
dnl Macro: DRIZZLE_PLUGIN_DISABLED
178
178
dnl
179
179
dnl SYNOPSIS
180
 
dnl   MYSQL_PLUGIN_DISABLED([name])
 
180
dnl   DRIZZLE_PLUGIN_DISABLED([name])
181
181
dnl
182
182
dnl DESCRIPTION
183
183
dnl   Marks the specified plugin as a disabled plugin
184
184
dnl
185
185
dnl ---------------------------------------------------------------------------
186
186
 
187
 
AC_DEFUN([MYSQL_PLUGIN_DISABLED],[
188
 
 MYSQL_REQUIRE_PLUGIN([$1])
189
 
 _MYSQL_PLUGIN_DISABLED([$1], 
190
 
  [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
191
 
  [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1])
 
187
AC_DEFUN([DRIZZLE_PLUGIN_DISABLED],[
 
188
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
189
 _DRIZZLE_PLUGIN_DISABLED([$1], 
 
190
  [DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
 
191
  [DRIZZLE_PLUGIN_MANDATORY_]AS_TR_CPP([$1])
192
192
 )
193
193
])
194
194
 
195
 
AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[
 
195
AC_DEFUN([_DRIZZLE_PLUGIN_DISABLED],[
196
196
 m4_define([$2], [yes])
197
197
 m4_ifdef([$3], [
198
198
  AC_FATAL([attempt to disable mandatory plugin $1])
202
202
 
203
203
 
204
204
dnl ---------------------------------------------------------------------------
205
 
dnl Macro: MYSQL_PLUGIN_DEPENDS
 
205
dnl Macro: DRIZZLE_PLUGIN_DEPENDS
206
206
dnl
207
207
dnl SYNOPSIS
208
 
dnl   MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...])
 
208
dnl   DRIZZLE_PLUGIN_DEPENDS([name],[prereq,prereq...])
209
209
dnl
210
210
dnl DESCRIPTION
211
211
dnl   Enables other plugins neccessary for the named plugin
215
215
dnl
216
216
dnl ---------------------------------------------------------------------------
217
217
 
218
 
AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[
219
 
 MYSQL_REQUIRE_PLUGIN([$1])
 
218
AC_DEFUN([DRIZZLE_PLUGIN_DEPENDS],[
 
219
 DRIZZLE_REQUIRE_PLUGIN([$1])
220
220
 ifelse($#, 2, [
221
 
  _MYSQL_PLUGIN_DEPEND([$1], $2)
 
221
  _DRIZZLE_PLUGIN_DEPEND([$1], $2)
222
222
 ], [
223
223
  AC_FATAL([bad number of arguments])
224
224
 ])
225
225
])
226
226
 
227
 
AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[
 
227
AC_DEFUN([_DRIZZLE_PLUGIN_DEPEND],[
228
228
 ifelse($#, 1, [], [$#:$2], [2:], [], [
229
 
  MYSQL_REQUIRE_PLUGIN([$2])
230
 
  _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2])
231
 
  _MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@)))
 
229
  DRIZZLE_REQUIRE_PLUGIN([$2])
 
230
  _DRIZZLE_PLUGAPPEND([__mysql_plugdepends_$1__],[$2])
 
231
  _DRIZZLE_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@)))
232
232
 ])
233
233
])
234
234
 
235
235
 
236
236
dnl ---------------------------------------------------------------------------
237
 
dnl Macro: MYSQL_PLUGIN_ACTIONS
 
237
dnl Macro: DRIZZLE_PLUGIN_ACTIONS
238
238
dnl
239
239
dnl SYNOPSIS
240
 
dnl   MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF])
 
240
dnl   DRIZZLE_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF])
241
241
dnl
242
242
dnl DESCRIPTION
243
243
dnl   Declares additional autoconf actions required to configure the plugin
244
244
dnl
245
245
dnl ---------------------------------------------------------------------------
246
246
 
247
 
AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
248
 
 MYSQL_REQUIRE_PLUGIN([$1])
 
247
AC_DEFUN([DRIZZLE_PLUGIN_ACTIONS],[
 
248
 DRIZZLE_REQUIRE_PLUGIN([$1])
249
249
 m4_ifdef([$2],[
250
 
   m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2]))
 
250
   m4_define([DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2]))
251
251
 ],[
252
 
   m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2])
 
252
   m4_define([DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2])
253
253
 ])
254
254
])
255
255
 
256
256
dnl ---------------------------------------------------------------------------
257
 
dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS
 
257
dnl Macro: DRIZZLE_PLUGIN_DEPENDS_ON_DRIZZLE_INTERNALS
258
258
dnl
259
259
dnl SYNOPSIS
260
 
dnl   MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name])
 
260
dnl   DRIZZLE_PLUGIN_DEPENDS_ON_DRIZZLE_INTERNALS([name],[file name])
261
261
dnl
262
262
dnl DESCRIPTION
263
263
dnl   Some modules in plugins keep dependance on structures
271
271
dnl
272
272
dnl ---------------------------------------------------------------------------
273
273
 
274
 
AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[
275
 
 MYSQL_REQUIRE_PLUGIN([$1])
276
 
 m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2])
 
274
AC_DEFUN([DRIZZLE_PLUGIN_DEPENDS_ON_DRIZZLE_INTERNALS],[
 
275
 DRIZZLE_REQUIRE_PLUGIN([$1])
 
276
 m4_define([DRIZZLE_PLUGIN_DEPENDS_ON_DRIZZLE_INTERNALS_]AS_TR_CPP([$1]), [$2])
277
277
])
278
278
 
279
279
dnl ---------------------------------------------------------------------------
280
 
dnl Macro: MYSQL_CONFIGURE_PLUGINS
 
280
dnl Macro: DRIZZLE_CONFIGURE_PLUGINS
281
281
dnl
282
282
dnl SYNOPSIS
283
 
dnl   MYSQL_PLUGIN_DEPENDS([name,name...])
 
283
dnl   DRIZZLE_PLUGIN_DEPENDS([name,name...])
284
284
dnl
285
285
dnl DESCRIPTION
286
286
dnl   Used last, emits all required shell code to configure the plugins
288
288
dnl
289
289
dnl ---------------------------------------------------------------------------
290
290
 
291
 
AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
 
291
AC_DEFUN([DRIZZLE_CONFIGURE_PLUGINS],[
292
292
 m4_ifdef([__mysql_plugin_configured__],[
293
 
   AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times])
 
293
   AC_FATAL([cannot use [DRIZZLE_CONFIGURE_PLUGINS] multiple times])
294
294
 ],[
295
295
   m4_define([__mysql_plugin_configured__],[done])
296
 
   _MYSQL_INCLUDE_LIST(
 
296
   _DRIZZLE_INCLUDE_LIST(
297
297
   m4_bpatsubst(m4_esyscmd([ls plugin/*/plug.in storage/*/plug.in 2>/dev/null]),
298
298
[[ 
299
299
]],[,]))
300
300
   m4_ifdef([__mysql_plugin_list__],[
301
 
    _MYSQL_CHECK_PLUGIN_ARGS([$1])
302
 
    _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
303
 
    _MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
 
301
    _DRIZZLE_CHECK_PLUGIN_ARGS([$1])
 
302
    _DRIZZLE_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
 
303
    _DRIZZLE_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
304
304
    AC_SUBST([mysql_se_dirs])
305
305
    AC_SUBST([mysql_pg_dirs])
306
306
    AC_SUBST([mysql_se_unittest_dirs])
313
313
 ])
314
314
])
315
315
 
316
 
AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[
 
316
AC_DEFUN([_DRIZZLE_CONFIGURE_PLUGINS],[
317
317
 ifelse($#, 0, [], $#, 1, [
318
 
  _MYSQL_EMIT_CHECK_PLUGIN([$1])
 
318
  _DRIZZLE_EMIT_CHECK_PLUGIN([$1])
319
319
 ],[
320
 
  _MYSQL_EMIT_CHECK_PLUGIN([$1])
321
 
  _MYSQL_CONFIGURE_PLUGINS(m4_shift($@))
 
320
  _DRIZZLE_EMIT_CHECK_PLUGIN([$1])
 
321
  _DRIZZLE_CONFIGURE_PLUGINS(m4_shift($@))
322
322
 ])
323
323
])
324
324
 
325
 
AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
326
 
 __MYSQL_EMIT_CHECK_PLUGIN(
 
325
AC_DEFUN([_DRIZZLE_EMIT_CHECK_PLUGIN],[
 
326
 __DRIZZLE_EMIT_CHECK_PLUGIN(
327
327
  [$1],
328
328
  m4_bpatsubst([$1], -, _),
329
 
  [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
330
 
  [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
331
 
  [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
332
 
  [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
333
 
  [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
334
 
  [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
335
 
  [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
336
 
  [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
337
 
  [MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]),
338
 
  [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
 
329
  [DRIZZLE_PLUGIN_NAME_]AS_TR_CPP([$1]),
 
330
  [DRIZZLE_PLUGIN_DESC_]AS_TR_CPP([$1]),
 
331
  [DRIZZLE_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
 
332
  [DRIZZLE_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
 
333
  [DRIZZLE_PLUGIN_STATIC_]AS_TR_CPP([$1]),
 
334
  [DRIZZLE_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
 
335
  [DRIZZLE_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
 
336
  [DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
 
337
  [DRIZZLE_PLUGIN_DEPENDS_ON_DRIZZLE_INTERNALS_]AS_TR_CPP([$1]),
 
338
  [DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
339
339
 )
340
340
])
341
341
 
342
 
AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
 
342
AC_DEFUN([__DRIZZLE_EMIT_CHECK_PLUGIN],[
343
343
 m4_ifdef([$5],[
344
344
  AH_TEMPLATE($5, [Include ]$4[ into mysqld])
345
345
 ])
473
473
 ])
474
474
])
475
475
 
476
 
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[
 
476
AC_DEFUN([_DRIZZLE_EMIT_PLUGIN_ACTIONS],[
477
477
 ifelse($#, 0, [], $#, 1, [
478
 
  _MYSQL_EMIT_PLUGIN_ACTION([$1])
 
478
  _DRIZZLE_EMIT_PLUGIN_ACTION([$1])
479
479
 ],[
480
 
  _MYSQL_EMIT_PLUGIN_ACTION([$1])
481
 
  _MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@))
 
480
  _DRIZZLE_EMIT_PLUGIN_ACTION([$1])
 
481
  _DRIZZLE_EMIT_PLUGIN_ACTIONS(m4_shift($@))
482
482
 ])
483
483
])
484
484
 
485
 
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[
486
 
 __MYSQL_EMIT_PLUGIN_ACTION(
 
485
AC_DEFUN([_DRIZZLE_EMIT_PLUGIN_ACTION],[
 
486
 __DRIZZLE_EMIT_PLUGIN_ACTION(
487
487
  [$1],
488
488
  m4_bpatsubst([$1], -, _),
489
 
  [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
490
 
  [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
 
489
  [DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
 
490
  [DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
491
491
 )
492
492
])
493
493
 
494
494
 
495
 
AC_DEFUN([__MYSQL_EMIT_PLUGIN_ACTION],[
 
495
AC_DEFUN([__DRIZZLE_EMIT_PLUGIN_ACTION],[
496
496
 m4_ifdef([$3], [], [
497
497
  if test "X[$with_plugin_]$2" = Xyes; then
498
498
    if test "X[$plugin_]$2[_static_target]" = X -a \
512
512
 
513
513
 
514
514
dnl SYNOPSIS
515
 
dnl   MYSQL_REQUIRE_PLUGIN([name])
 
515
dnl   DRIZZLE_REQUIRE_PLUGIN([name])
516
516
dnl
517
517
dnl DESCRIPTION
518
518
dnl   Checks that the specified plugin does exist
519
519
 
520
 
AC_DEFUN([MYSQL_REQUIRE_PLUGIN],[
521
 
 _MYSQL_REQUIRE_PLUGIN([$1], [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__])
 
520
AC_DEFUN([DRIZZLE_REQUIRE_PLUGIN],[
 
521
 _DRIZZLE_REQUIRE_PLUGIN([$1], [__DRIZZLE_PLUGIN_]AS_TR_CPP([$1])[__])
522
522
])
523
523
 
524
 
define([_MYSQL_REQUIRE_PLUGIN],[
 
524
define([_DRIZZLE_REQUIRE_PLUGIN],[
525
525
 ifdef([$2],[
526
526
  ifelse($2, [$1], [], [
527
 
   AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1])
 
527
   AC_FATAL([Misspelt DRIZZLE_PLUGIN declaration for $1])
528
528
  ])
529
529
 ],[
530
 
  AC_FATAL([Missing MYSQL_PLUGIN declaration for $1])
 
530
  AC_FATAL([Missing DRIZZLE_PLUGIN declaration for $1])
531
531
 ])
532
532
])
533
533
 
536
536
 
537
537
 
538
538
dnl SYNOPSIS
539
 
dnl   _MYSQL_EMIT_METAPLUGINS([name,name...])
 
539
dnl   _DRIZZLE_EMIT_METAPLUGINS([name,name...])
540
540
dnl
541
541
dnl DESCRIPTION
542
542
dnl   Emits shell code for metaplugins
543
543
 
544
 
AC_DEFUN([_MYSQL_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1,
545
 
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
 
544
AC_DEFUN([_DRIZZLE_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1,
 
545
[_DRIZZLE_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
546
546
],
547
 
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
548
 
_MYSQL_EMIT_METAPLUGINS(m4_shift($@))])
 
547
[_DRIZZLE_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
 
548
_DRIZZLE_EMIT_METAPLUGINS(m4_shift($@))])
549
549
])
550
550
 
551
 
AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [
 
551
AC_DEFUN([_DRIZZLE_EMIT_METAPLUGIN], [
552
552
  [$1] )
553
553
m4_ifdef([$2], [
554
554
    mysql_plugins='m4_bpatsubst($2, :, [ ])'
563
563
 
564
564
 
565
565
dnl SYNOPSIS
566
 
dnl   _MYSQL_PLUGAPPEND([name],[to-append])
 
566
dnl   _DRIZZLE_PLUGAPPEND([name],[to-append])
567
567
dnl
568
568
dnl DESCRIPTION
569
569
dnl   Helper macro for appending to colon-delimited lists
570
570
dnl   Optinal 3rd argument is for actions only required when defining
571
571
dnl   macro named for the first time.
572
572
 
573
 
AC_DEFUN([_MYSQL_PLUGAPPEND],[
 
573
AC_DEFUN([_DRIZZLE_PLUGAPPEND],[
574
574
 m4_ifdef([$1],[
575
575
  m4_define([__plugin_append_tmp__], m4_defn([$1]))
576
576
  m4_undefine([$1])
584
584
 
585
585
 
586
586
dnl SYNOPSIS
587
 
dnl   _MYSQL_PLUGAPPEND_META([name],[meta,meta...])
 
587
dnl   _DRIZZLE_PLUGAPPEND_META([name],[meta,meta...])
588
588
dnl
589
589
dnl DESCRIPTION
590
590
dnl   Helper macro for adding plugins to meta plugins
591
591
 
592
 
AC_DEFUN([_MYSQL_PLUGAPPEND_META],[
 
592
AC_DEFUN([_DRIZZLE_PLUGAPPEND_META],[
593
593
 ifelse($#, 1, [], [$#:$2], [2:], [], [$2], [all], [
594
594
  AC_FATAL([protected plugin group: all])
595
595
 ], [$2], [none], [
596
596
  AC_FATAL([protected plugin group: none])
597
597
 ],[
598
 
  _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2])
599
 
  _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [
600
 
   _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2])
 
598
  _DRIZZLE_PLUGAPPEND([__mysql_$1_configs__],[$2])
 
599
  _DRIZZLE_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [
 
600
   _DRIZZLE_PLUGAPPEND([__mysql_metaplugin_list__],[$2])
601
601
  ])
602
 
  _MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@)))
 
602
  _DRIZZLE_PLUGAPPEND_META([$1], m4_shift(m4_shift($@)))
603
603
 ])
604
604
])
605
605
 
608
608
 
609
609
 
610
610
dnl SYNOPSIS
611
 
dnl   MYSQL_LIST_PLUGINS
 
611
dnl   DRIZZLE_LIST_PLUGINS
612
612
dnl
613
613
dnl DESCRIPTION
614
614
dnl   Emits formatted list of declared plugins
615
615
 
616
 
AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl
 
616
AC_DEFUN([DRIZZLE_LIST_PLUGINS],[dnl
617
617
 m4_ifdef([__mysql_plugin_list__],[dnl
618
 
  _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl
 
618
  _DRIZZLE_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl
619
619
 ])dnl
620
620
])
621
621
 
622
 
AC_DEFUN([_MYSQL_LIST_PLUGINS],[dnl
 
622
AC_DEFUN([_DRIZZLE_LIST_PLUGINS],[dnl
623
623
 ifelse($#, 0, [], $#, 1, [dnl
624
 
  MYSQL_SHOW_PLUGIN([$1])dnl
 
624
  DRIZZLE_SHOW_PLUGIN([$1])dnl
625
625
 ],[dnl
626
 
  MYSQL_SHOW_PLUGIN([$1])dnl
627
 
  _MYSQL_LIST_PLUGINS(m4_shift($@))dnl
 
626
  DRIZZLE_SHOW_PLUGIN([$1])dnl
 
627
  _DRIZZLE_LIST_PLUGINS(m4_shift($@))dnl
628
628
 ])dnl
629
629
])
630
630
 
631
 
AC_DEFUN([MYSQL_SHOW_PLUGIN],[
632
 
 _MYSQL_SHOW_PLUGIN(
 
631
AC_DEFUN([DRIZZLE_SHOW_PLUGIN],[
 
632
 _DRIZZLE_SHOW_PLUGIN(
633
633
  [$1],
634
634
  [$1-plugin],
635
 
  [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
636
 
  [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
637
 
  [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
638
 
  [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
639
 
  [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
640
 
  [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
641
 
  [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
642
 
  [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
643
 
  [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),
 
635
  [DRIZZLE_PLUGIN_NAME_]AS_TR_CPP([$1]),
 
636
  [DRIZZLE_PLUGIN_DESC_]AS_TR_CPP([$1]),
 
637
  [DRIZZLE_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
 
638
  [DRIZZLE_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
 
639
  [DRIZZLE_PLUGIN_STATIC_]AS_TR_CPP([$1]),
 
640
  [DRIZZLE_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
 
641
  [DRIZZLE_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
 
642
  [DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
 
643
  [DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),
644
644
  __mysql_[$1]_configs__,
645
645
 )
646
646
])
647
647
 
648
 
AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl
 
648
AC_DEFUN([_DRIZZLE_SHOW_PLUGIN],[dnl
649
649
  === $3 ===
650
650
  Plugin Name:      [$1]
651
651
  Description:      $4
666
666
dnl ---------------------------------------------------------------------------
667
667
 
668
668
 
669
 
AC_DEFUN([_MYSQL_EMIT_PLUGINS],[
 
669
AC_DEFUN([_DRIZZLE_EMIT_PLUGINS],[
670
670
 ifelse($#, 0, [], [$#:$1], [1:], [], [
671
 
  m4_ifdef([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [
672
 
   m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ])
 
671
  m4_ifdef([DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [
 
672
   m4_define([DRIZZLE_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ])
673
673
  ])
674
674
    [$1] )
675
 
  m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
 
675
  m4_ifdef([DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
676
676
      AC_MSG_ERROR([plugin $1 is disabled])
677
677
  ],[
678
 
    _MYSQL_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _),
679
 
      [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
680
 
      [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
681
 
      [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]))
 
678
    _DRIZZLE_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _),
 
679
      [DRIZZLE_PLUGIN_NAME_]AS_TR_CPP([$1]),
 
680
      [DRIZZLE_PLUGIN_STATIC_]AS_TR_CPP([$1]),
 
681
      [DRIZZLE_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]))
682
682
  ])
683
683
      ;;
684
 
  _MYSQL_EMIT_PLUGINS(m4_shift($@))
 
684
  _DRIZZLE_EMIT_PLUGINS(m4_shift($@))
685
685
 ])
686
686
])
687
687
 
688
 
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[
 
688
AC_DEFUN([_DRIZZLE_EMIT_PLUGIN_ENABLE],[
689
689
    m4_ifdef([$5],m4_ifdef([$4],[
690
690
      [mysql_plugin_]$2=yes
691
691
    ],[
695
695
    ])      
696
696
])
697
697
 
698
 
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDS], [
 
698
AC_DEFUN([_DRIZZLE_EMIT_PLUGIN_DEPENDS], [
699
699
 ifelse($#, 0, [], [$#:$1], [1:], [], [
700
 
  _MYSQL_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _), 
 
700
  _DRIZZLE_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _), 
701
701
                            [__mysql_plugdepends_$1__])
702
 
  _MYSQL_EMIT_PLUGIN_DEPENDS(m4_shift($@))
 
702
  _DRIZZLE_EMIT_PLUGIN_DEPENDS(m4_shift($@))
703
703
 ])
704
704
])
705
705
 
706
 
AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [
 
706
AC_DEFUN([_DRIZZLE_EMIT_CHECK_DEPENDS], [
707
707
 m4_ifdef([$2], [
708
708
   if test "X[$mysql_plugin_]$1" = Xyes -a \
709
709
           "X[$with_plugin_]$1" != Xno -o \
710
710
           "X[$with_plugin_]$1" = Xyes; then
711
 
     _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,]))
 
711
     _DRIZZLE_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,]))
712
712
   fi
713
713
 ])
714
714
])
715
715
 
716
 
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [
 
716
AC_DEFUN([_DRIZZLE_EMIT_PLUGIN_DEPENDENCIES], [
717
717
 ifelse([$1], [], [], [
718
 
  m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
 
718
  m4_ifdef([DRIZZLE_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
719
719
       AC_MSG_ERROR([depends upon disabled plugin $1])
720
720
  ],[
721
721
       [mysql_plugin_]m4_bpatsubst([$1], -, _)=yes
723
723
         AC_MSG_ERROR([depends upon disabled plugin $1])
724
724
       fi
725
725
  ])
726
 
  _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@))
 
726
  _DRIZZLE_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@))
727
727
 ])
728
728
])
729
729
 
730
730
dnl SYNOPSIS
731
 
dnl   _MYSQL_CHECK_PLUGIN_ARGS([plugin],[plugin]...)
 
731
dnl   _DRIZZLE_CHECK_PLUGIN_ARGS([plugin],[plugin]...)
732
732
dnl
733
733
dnl DESCRIPTION
734
734
dnl   Emits shell script for checking configure arguments
735
735
dnl   Arguments to this macro is default value for selected plugins
736
736
 
737
 
AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[
738
 
 __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [none]))
 
737
AC_DEFUN([_DRIZZLE_CHECK_PLUGIN_ARGS],[
 
738
 __DRIZZLE_CHECK_PLUGIN_ARGS(m4_default([$1], [none]))
739
739
])
740
740
 
741
 
AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[
 
741
AC_DEFUN([__DRIZZLE_CHECK_PLUGIN_ARGS],[
742
742
 AC_ARG_WITH([plugins],
743
743
AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]],
744
744
               [Plugins to include in mysqld. (default is: $1) Must be a
761
761
 
762
762
m4_divert_once([HELP_VAR_END],[
763
763
Description of plugins:
764
 
MYSQL_LIST_PLUGINS])
 
764
DRIZZLE_LIST_PLUGINS])
765
765
 
766
766
  case "$mysql_plugins" in
767
767
  all )
771
771
    mysql_plugins=''
772
772
    ;;
773
773
m4_ifdef([__mysql_metaplugin_list__],[
774
 
_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,]))
 
774
_DRIZZLE_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,]))
775
775
])
776
776
  esac
777
777
 
780
780
    all | none )
781
781
      AC_MSG_ERROR([bad plugin name: $plugin])
782
782
      ;;
783
 
_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
 
783
_DRIZZLE_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
784
784
    * )
785
785
      AC_MSG_ERROR([unknown plugin: $plugin])
786
786
      ;;
787
787
    esac
788
788
  done
789
789
 
790
 
  _MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
 
790
  _DRIZZLE_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
791
791
])
792
792
 
793
793
dnl ---------------------------------------------------------------------------
794
 
dnl Macro: _MYSQL_INCLUDE_LIST
 
794
dnl Macro: _DRIZZLE_INCLUDE_LIST
795
795
dnl
796
796
dnl SYNOPSIS
797
 
dnl   _MYSQL_INCLUDE_LIST([filename,filename...])
 
797
dnl   _DRIZZLE_INCLUDE_LIST([filename,filename...])
798
798
dnl
799
799
dnl DESCRIPTION
800
800
dnl   includes all files from the list
801
801
dnl
802
802
dnl ---------------------------------------------------------------------------
803
 
AC_DEFUN([_MYSQL_INCLUDE_LIST],[
 
803
AC_DEFUN([_DRIZZLE_INCLUDE_LIST],[
804
804
 ifelse([$1], [], [], [
805
805
  m4_define([__mysql_include__],[$1])
806
806
  dnl We have to use builtin(), because sinclude would generate an error
808
808
  dnl violating m4 specs, and which is fixed in aclocal-1.9
809
809
  builtin([include],$1)
810
810
  m4_undefine([__mysql_include__])
811
 
  _MYSQL_INCLUDE_LIST(m4_shift($@))
 
811
  _DRIZZLE_INCLUDE_LIST(m4_shift($@))
812
812
 ])
813
813
])
814
814