pcb-rnd - plugin development - external pupplug plugin + FAQ

First of all: you should write a core plugin, not an external plugin.

If you absolutely can't avoid writing an external plugin, you have two choices: a native puplug plugin or a fungw engine plugin. This page is about the puplug plugin method. Pro: have full access to all APIs. Con: more boilerplate code.

Please refer to the example/template plugin. After make and make install, starting pcb-rnd should auto-load the plugin. The stderr message from init should appear. The ExtFoo action should be available.

To start your external plugin, copy it to new directory and rename ext_foo both in file names and file content. Make sure to fill in the fields in the pup file. Please preserve the ext_ prefix.

how to develop the plugin

Other than some naming conventions and the #includes, which are either "src/*.h" or you need an extra -I for src/, everything is as documented for core plugins.

how to access pcb-rnd's CC, CFLAGS, LDFLAGS, etc.

For that you need to use scconfig to configure your external plugin. Once you do that, you can use the --import=$(TRUNK)/scconfig/config.cache argument, which will get scconfig to read everything cached during pcb-rnd's configuration. This will save running some detections that are already done for pcb-rnd and will also import the exact results of CC, CFLAGS, LDFLAGS, etc.

After that, you should get your hooks.c to generate a conf file you can include from your Makefile.

Note: we generally do not support having external plugins, so please do not make requests for pcb-rnd's Makefile.conf to contain whatever nodes your external plugin may need.

How to use autotools, cmake, qmake, ...

No idea, at pcb-rnd we don't use those - we don't provide support for those tools.

Suddenly pcb-rnd core API changed and my external plugin broke!

We told you so. Please consider restarting your plugin from scratch as a core plugin. If you can't, you will have to live with frequent API changes. pcb-rnd is not a lib, but an application, we do not promote developing external plugins, so we don't feel obliged to keep internal API backward compatibility.

The API changes too often. Can you stop doing that please?

No.

The API changes too often. Could you please maintain my external plugin?

No.

The API changes too often. Could you please include my external plugin as core plugin?

No.