@@ -32,8 +32,8 @@ AC_DEFUN([MYSQL_MODULE],[
3232
3333AC_DEFUN ( [ _MYSQL_MODULE] ,[
3434 m4_ifdef ( [ $2 ] , [
35- AC_FATAL ( [ [ Duplicate MYSQL_MODULE declaration for ] ] [ $3 ] )
36- ] ,[ dnl
35+ AC_FATAL ( [ Duplicate MYSQL_MODULE declaration for $3 ] )
36+ ] ,[
3737 m4_define ( [ $2 ] , [ $1 ] )
3838 _MYSQL_PLUGAPPEND([ __mysql_plugin_list__] ,[ $1 ] )
3939 m4_define ( [ MYSQL_MODULE_NAME_] AS_TR_CPP ( [ $1 ] ) , [ $3 ] )
@@ -57,13 +57,14 @@ AC_DEFUN([MYSQL_STORAGE_ENGINE],[
5757 MYSQL_MODULE([ $1 ] , [ $3 ] , [ $4 ] , [ [ $5 ] ] )
5858 MYSQL_MODULE_DEFINE([ $1 ] , [ WITH_] AS_TR_CPP ( [ $1 ] ) [ _STORAGE_ENGINE] )
5959 ifelse ( [ $2 ] ,[ no] ,[ ] ,[
60- _MYSQL_LEGACY_STORAGE_ENGINE([ $1 ] ,m4_default ( [ $2 ] , [ $1 -storage-engine] ) )
60+ _MYSQL_LEGACY_STORAGE_ENGINE(
61+ m4_bpatsubst ( m4_default ( [ $2 ] , [ $1 -storage-engine] ) , - , _ ) )
6162 ] )
6263] )
6364
6465AC_DEFUN ( [ _MYSQL_LEGACY_STORAGE_ENGINE] ,[
65- if test "[ ${with_] m4_bpatsubst ( $2 , - , _ ) [ +set}] " = set; then
66- [ with_module_] m4_bpatsubst ( $1 , - , _ ) ="[ $with_] m4_bpatsubst ( $2 , - , _ ) "
66+ if test "[ ${with_] $1 [ +set}] " = set; then
67+ [ with_module_] $1 ="[ $with_] $1 "
6768fi
6869] )
6970
@@ -188,7 +189,7 @@ dnl ---------------------------------------------------------------------------
188189AC_DEFUN ( [ MYSQL_MODULE_DEPENDS] ,[
189190 REQUIRE_PLUGIN([ $1 ] )
190191 ifelse ( $# , 0 , [ ] , $# , 1 , [
191- AC_FATAL ( [ [ bad number of arguments] ] )
192+ AC_FATAL ( [ bad number of arguments] )
192193 ] , $# , 2 , [
193194 _MYSQL_MODULE_DEPEND([ $1 ] ,[ $2 ] )
194195 ] ,[
@@ -238,7 +239,8 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
238239 _MYSQL_CHECK_PLUGIN_ARGS([ $1 ] )
239240 _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst ( __mysql_plugin_list__ , : , [ ,] ) )
240241 _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst ( __mysql_plugin_list__ , : , [ ,] ) )
241- _MYSQL_POST_PLUGIN_FIXUP()
242+ AC_SUBST ( [ mysql_se_dirs] )
243+ AC_SUBST ( [ mysql_pg_dirs] )
242244 ] )
243245 ] )
244246] )
@@ -273,16 +275,19 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[
273275 AH_TEMPLATE ( $5 , [ Include ] $4 [ into mysqld] )
274276 ] )
275277 AC_MSG_CHECKING ( [ whether to use ] $3 )
278+ mysql_use_plugin_dir=""
276279 m4_ifdef ( [ $1 0] ,[
277280 if test "[ $mysql_module_] $2 " = yes -a \
278281 "[ $with_module_] $2 " != no -o \
279282 "[ $with_module_] $2 " = yes; then
283+ AC_MSG_RESULT ( [ error] )
280284 AC_MSG_ERROR ( [ disabled] )
281285 fi
282286 AC_MSG_RESULT ( [ no] )
283287 ] ,[
284288 m4_ifdef ( [ $9 ] ,[
285289 if test "[ $with_module_] $2 " = no; then
290+ AC_MSG_RESULT ( [ error] )
286291 AC_MSG_ERROR ( [ cannot disable mandatory module] )
287292 fi
288293 [ mysql_module_] $2 =yes
@@ -295,7 +300,7 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[
295300 m4_ifdef ( [ $8 ] ,[
296301 m4_ifdef ( [ $6 ] ,[
297302 if test -d "$srcdir/$6 " ; then
298- mysql_plugin_dirs="$mysql_plugin_dirs $6 "
303+ mysql_use_plugin_dir=" $6 "
299304 ] )
300305 AC_SUBST ( [ plugin_] $2 [ _shared_target] , "$8 " )
301306 AC_SUBST ( [ plugin_] $2 [ _static_target] , [ ""] )
@@ -315,19 +320,19 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[
315320 m4_ifdef ( [ $7 ] ,[
316321 ifelse ( m4_bregexp ( $7 , [ ^lib[ ^.] +\.a$] ) , - 2 , [
317322 m4_ifdef ( [ $6 ] ,[
318- mysql_plugin_dirs="$mysql_plugin_dirs $6 "
323+ mysql_use_plugin_dir=" $6 "
319324 mysql_plugin_libs="$mysql_plugin_libs -L[ \$(top_builddir)] /$6 "
320325 ] )
321326 mysql_plugin_libs="$mysql_plugin_libs
322327[ -l] m4_bregexp ( $7 , [ ^lib\([ ^.] +\)] , [ \1] ) "
323328 ] , m4_bregexp ( $7 , [ ^\\\$] ) , 0 , [
324329 m4_ifdef ( [ $6 ] ,[
325- mysql_plugin_dirs="$mysql_plugin_dirs $6 "
330+ mysql_use_plugin_dir=" $6 "
326331 ] )
327332 mysql_plugin_libs="$mysql_plugin_libs $7 "
328333 ] , [
329334 m4_ifdef ( [ $6 ] ,[
330- mysql_plugin_dirs="$mysql_plugin_dirs $6 "
335+ mysql_use_plugin_dir=" $6 "
331336 mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6 /$7 "
332337 ] ,[
333338 mysql_plugin_libs="$mysql_plugin_libs $7 "
@@ -340,7 +345,8 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[
340345 AC_SUBST ( [ plugin_] $2 [ _shared_target] , [ ""] )
341346 ] ,[
342347 m4_ifdef ( [ $6 ] ,[
343- AC_FATAL ( [ plugin directory specified without library for ] $3 )
348+ AC_MSG_RESULT ( [ error] )
349+ AC_MSG_ERROR ( [ Plugin $1 does not support static linking] )
344350 ] ,[
345351 m4_ifdef ( [ $5 ] ,[
346352 AC_DEFINE ( $5 )
@@ -353,6 +359,21 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[
353359 [ with_module_] $2 =yes
354360 AC_MSG_RESULT ( [ yes] )
355361 fi
362+ m4_ifdef ( [ $6 ] ,[
363+ if test -n "$mysql_use_plugin_dir" ; then
364+ mysql_plugin_dirs="$mysql_plugin_dirs $6 "
365+ if test -f "$srcdir/$6 /configure" ; then
366+ other_configures="$other_configures $6 /configure"
367+ else
368+ AC_CONFIG_FILES ( $6 / Makefile )
369+ fi
370+ ifelse ( m4_substr ( $6 , 0 , 8 ) , [ storage/] ,
371+ [ mysql_se_dirs="$mysql_se_dirs ] m4_substr ( $6 , 8 ) " ,
372+ m4_substr ( $6 , 0 , 7 ) , [ plugin/] ,
373+ [ mysql_pg_dirs="$mysql_pg_dirs ] m4_substr ( $6 , 7 ) " ,
374+ [ AC_FATAL ( [ don't know how to handle plugin dir ] $6 ) ] )
375+ fi
376+ ] )
356377 fi
357378 ] )
358379] )
@@ -409,10 +430,10 @@ AC_DEFUN([REQUIRE_PLUGIN],[
409430define ( [ _REQUIRE_PLUGIN] ,[
410431 ifdef ( [ $2 ] ,[
411432 ifelse ( $2 , [ $1 ] , [ ] , [
412- AC_FATAL ( [ [ Misspelt MYSQL_MODULE declaration for ] ] [ $1 ] )
433+ AC_FATAL ( [ Misspelt MYSQL_MODULE declaration for $1 ] )
413434 ] )
414435 ] ,[
415- AC_FATAL ( [ [ Missing MYSQL_MODULE declaration for ] ] [ $1 ] )
436+ AC_FATAL ( [ Missing MYSQL_MODULE declaration for $1 ] )
416437 ] )
417438] )
418439
@@ -455,7 +476,7 @@ AC_DEFUN([_MYSQL_PLUGAPPEND],[
455476
456477AC_DEFUN ( [ _MYSQL_PLUGAPPEND_OPTS] ,[
457478 ifelse ( $# , 0 , [ ] , $# , 1 , [
458- AC_FATAL ( [ [ bad number of args] ] )
479+ AC_FATAL ( [ bad number of args] )
459480 ] , $# , 2 , [
460481 _MYSQL_PLUGAPPEND_OPTONE([ $1 ] ,[ $2 ] )
461482 ] ,[
@@ -466,10 +487,10 @@ AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[
466487
467488AC_DEFUN ( [ _MYSQL_PLUGAPPEND_OPTONE] ,[
468489 ifelse ( [ $2 ] , [ all] , [
469- AC_FATAL ( [ [ protected plugin group: all] ] )
490+ AC_FATAL ( [ protected plugin group: all] )
470491 ] ,[
471492 ifelse ( [ $2 ] , [ none] , [
472- AC_FATAL ( [ [ protected plugin group: none] ] )
493+ AC_FATAL ( [ protected plugin group: none] )
473494 ] ,[
474495 _MYSQL_PLUGAPPEND([ __mysql_$1 _configs__] ,[ $2 ] )
475496 _MYSQL_PLUGAPPEND([ __mysql_] m4_bpatsubst ( $2 , - , _ ) [ _plugins__] ,[ $1 ] , [
@@ -516,7 +537,7 @@ AC_DEFUN([MYSQL_SHOW_PLUGIN],[
516537] )
517538
518539AC_DEFUN ( [ _MYSQL_SHOW_PLUGIN] ,[ dnl
519- === Plugin: $3 ===
540+ === $3 ===
520541 Module Name: [ $1 ]
521542 Description: $4
522543 Supports build: _PLUGIN_BUILD_TYPE([ $7 ] ,[ $8 ] )[ ] dnl
@@ -666,27 +687,4 @@ _MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
666687 _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst ( __mysql_plugin_list__ , : , [ ,] ) )
667688] )
668689
669- AC_DEFUN ( [ _MYSQL_POST_PLUGIN_FIXUP] ,[
670- for plugdir in $mysql_plugin_dirs; do
671- case "$plugdir" in
672- storage/* )
673- mysql_se_dirs="$mysql_se_dirs `echo $plugdir | sed -e 's@^storage/@@'`"
674- ;;
675- plugin/* )
676- mysql_pg_dirs="$mysql_pg_dirs `echo $plugdir | sed -e 's@^plugin/@@'`"
677- ;;
678- *)
679- AC_MSG_ERROR ( [ don't know how to handle plugin dir $plugdir] )
680- ;;
681- esac
682- if test -f "$srcdir/$plugdir/configure" ; then
683- other_configures="$other_configures $plugdir/configure"
684- else
685- ac_config_files="$ac_config_files $plugdir/Makefile"
686- fi
687- done
688- AC_SUBST ( mysql_se_dirs )
689- AC_SUBST ( mysql_pg_dirs )
690- ] )
691-
692690dnl ===========================================================================
0 commit comments