---
name: "tp-magic-config"
section: "1"
platform: "linux"
package: "tuxpaint-dev"
version: "1:0.9.23-1.1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/tp-magic-config"
---

# tp-magic-config(1)

## NAME

tp-magic-config -- Helps creating 'Magic' tool plugins for Tux Paint(1)

## SYNOPSIS

- **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:\
\
 	mkdir -p $(MAGIC\_PREFIX)\
\
 	cp my\_plugin.so $(MAGIC\_PREFIX)/\
\
 	chmod 644 $(MAGIC\_PREFIX)/my\_plugin.so

install-data:\
\
 	mkdir -p $(DATA\_PREFIX)\
\
 	cp icons/my\_plugin\_icon.png $(DATA\_PREFIX)/images/magic/\
\
 	chmod 644 $(DATA\_PREFIX)/images/magic/my\_plugin\_icon.png

install-docs:\
\
 	mkdir -p $(MAGIC\_DOC\_PREFIX)\
\
 	cp docs/my\_plugin.html $(MAGIC\_DOC\_PREFIX)/html/\
\
 	chmod 644 $(MAGIC\_DOC\_PREFIX)/html/my\_plugin.html\
\
 	cp docs/my\_plugin.txt $(MAGIC\_DOC\_PREFIX)/\
\
 	chmod 644 $(MAGIC\_DOC\_PREFIX)/my\_plugin.txt

## AUTHOR

Bill Kendrick.  \<bill@newbreedsoftware.com\>

## SEE ALSO

[**tuxpaint**(1)](/tuxpaint/1.md),

And documentation within /usr/\[local/\]share/doc/tuxpaint/.
