tp-magic-config (1) Linux Manual Page
tp-magic-config — Helps creating ‘Magic’ tool plugins for Tux Paint(1)
Synopsys
- tp-magic-config [–apiversion | –version | –cflags | –pluginprefix | –plugindocprefix | –dataprefix | –localpluginprefix | –localdataprefix]
Description
tp-magic-config is a simple shell script that responds with various pieces of information about the currently-installed version of Tux Paint(1) that are useful when building ‘Magic’ tool plugins.Options
- –apiversion
- Outputs the version of the Tux Paint ‘Magic’ tool plugin API that the installed copy of Tux Paint supports. (For API compatibility testing.)
- –version
- Outputs the version of Tux Paint that tp-magic-config corresponds to.
- –cflags
- Outputs the compiler flags that Tux Paint ‘Magic’ tool plugins should be compiled with. (For example, a "-I" include path option that tells the compiler where it can find the plugin API header file, "tp_magic_config.h", that plugins must #include.)
- –pluginprefix
- Outputs the system directory where the installed copy of Tux Paint expects to find ‘Magic’ tool plugins (".so" shared objects). (e.g., "/usr/share/tuxpaint/plugins")
- –localpluginprefix
- Outputs the user directory where the installed copy of Tux Paint expects to find ‘Magic’ tool plugins (".so" shared objects). (e.g., "/home/username/.tuxpaint/plugins")
- –plugindocprefix
- Outputs the directory where the installed copy of Tux Paint expects to find documentation for ‘Magic’ tool plugins (".html" and ".txt" files). Tux Paint’s main documentation includes a link to this directory under the section on "Magic" tools.
- –dataprefix
- Outputs the system directory where the installed copy of Tux Paint keeps its global data files (e.g., "/usr/share/tuxpaint/"). This is the same value that plugins installed system-wide will receive in the "data_directory" string within the "magic_api" structure sent to the plugins’ functions.
- –localdataprefix
- Outputs the user directory where the installed copy of Tux Paint expects plugins to install their local data files. (e.g., "/home/username/.tuxpaint/plugins/data"). This is the same value that plugins installed locally will receive in the "data_directory" string within the "magic_api" structure sent to the plugins’ functions.
System-Wide Shell Examples
$ gcc -shared `tp-magic-config –cflags` my_plugin.c -o my_plugin.so# cp my_plugin.so `tp-magic-config –pluginprefix`
# cp my_plugin_icon.png `tp-magic-config –dataprefix`/images/magic
# cp my_plugin.html `tp-magic-config –plugindocrefix`/html
# cp my_plugin.txt `tp-magic-config –plugindocrefix`
Local Shell Examples
$ gcc -shared `tp-magic-config –cflags` my_plugin.c -o my_plugin.so$ mkdir -p `tp-magic-config –localpluginprefix`
$ cp my_plugin.so `tp-magic-config –localpluginprefix`
$ mkdir -p `tp-magic-config –localdataprefix`/images/magic
$ cp my_plugin_icon.png `tp-magic-config –localdataprefix`/images/magic
System-Wide Makefile Example
MAGIC_CFLAGS=$(shell tp-magic-config –cflags)MAGIC_PREFIX=$(shell tp-magic-config –pluginprefix)
MAGIC_DOC_PREFIX=$(shell tp-magic-config –plugindocprefix)
DATA_PREFIX=$(shell tp-magic-config –dataprefix)
all: my_plugin.so
my_plugin.so: my_plugin.c
install: install-so install-data install-docs
install-so:
install-data:
install-docs:
Author
Bill Kendrick. <bill [at] newbreedsoftware.com>See Also
tuxpaint(1),And documentation within /usr/[local/]share/doc/tuxpaint/.
