← Back to team overview

mysql-proxy-discuss team mailing list archive

external plugins in MySQL Proxy 0.8

 

Hi everyone,

in 0.8.0 (really close to a release) we added the possibility to build plugins outside of the source-tree.

  $ make install

will install the header files in the include/ folder of your choice and we'll add 2 .pc files to make the integration with pkg-config straight-forward.

All you need in your stand-alone plugin is

  PKG_CHECK_MODULES(CHASSIS, mysql-proxy >= 0.8.0)

... which exposes CHASSIS_CFLAGS and CHASSIS_LIBS to be used with your plugins Makefile.am.

To install the plugins in the right place the pkg-config file exposes two extra variables:

  CHASSIS_LUALIBDIR=`${PKG_CONFIG} --variable=lualibdir mysql-proxy`
  AC_SUBST(CHASSIS_LUALIBDIR)
  CHASSIS_PLUGINDIR=`${PKG_CONFIG} --variable=plugindir mysql-proxy`
  AC_SUBST(CHASSIS_PLUGINDIR)

which you can use too to install your plugin in the same folder as the proxy itself:

  plugindir=${CHASSIS_PLUGINDIR}
  plugin_LTLIBRARIES = libskeleton.la
  libskeleton_la_SOURCES = skeleton.la
libskeleton_la_LDFLAGS = -export-dynamic -no-undefined -no-version -dynamic
  libskeleton_la_LIBADD   = ${CHASSIS_LIBS}
  libskeleton_la_CFLAGS = ${CHASSIS_CFLAGS}

Jan