README for example pd external package 'hello'

Last updated for hello v0.01


The 'hello' package is an example external package intended to demonstrate one way of using GNU autotools (automake, autoconf, autoheader) to manage a Pd external distribution.

See HOWTO for a developer-oriented introduction.


Issue the following commands to the shell:

   cd PACKAGE-XX.YY  (or wherever you extracted the distribution)
   make install


The 'configure' script supports the following options, among others:


This section provides a brief developer-oriented description of how to use GNU autotools to manage your own Pd external package.



The directory common/ includes common code for the autotools packages. Copy it to your top-level package directory.


Contains m4 macros for autotools. See ax_pd_external.m4 for details.


May be included in your package's See for details.

$(top_srcdir)/common/mooPdUtils.h (optional)

The file mooPdUtils.h may be included by your C source files. Currently, this only provides a PDEXT_UNUSED macro to avoid annoying gcc warnings under -W.

Running aclocal

You must pass the ``-I common/m4'' flag to aclocal when you call it. For maintainer-mode rebuilding and autoreconf, you should add the following to your top-level

 ACLOCAL_AMFLAGS = -I $(top_srcdir)/common/m4

See the example package's for a useful wrapper script.

You must call the macro AX_PD_EXTERNAL from Before doing so (and before calling AC_PROG_CC), make sure that you cache the values of important user flags in shell variables:

 ##-- save user's CFLAGS,CPPFLAGS
 ##-- Pd external stuff

See the example package's for a complete working example.

You probably want to include $(top_srcdir)/common/ in your This will allow you to build Pd externals as ``_PROGRAMS'' targets. In particular, pdext_PROGRAMS targets will be built as externals and installed in PDEXT_DIR (see above).

See the example package's for a complete working example.


To build & install the external ``hello.$(PDEXT)'', add the following to

 pdexterns_PROGRAMS = hello
 hello_SOURCES = hello.c mooPdUtils.h

To install the abstraction ``heynow.pd'', add the following to

 pdexterns_DATA = heynow.pd

To install the documentation patch ``hello-help.pd'', add the following to

 pddoc_DATA = hello-help.pd


The AX_PD_EXTERNAL macro defined in common/m4/ax_pd_external.m4 is intended to perform all common autoconf-level checks and substitutions necessary for building Pd external packages on various systems. Among other things, this includes:

See the comments at the top of m4/ax_pd_external.m4 for more details on the AX_PD_EXTERNAL macro. is intended to be included in your package's It redefines the automake EXEEXT to allow building Pd externals using automake's _PROGRAMS targets. Additionally, it defines the automake varibles PDEXT, SUFFIXES, EXTRA_DIST, CLEANFILES, DISTCLEANFILES, and MAINTAINERCLEANFILES.

Multilibs and Single-Object Externals

You can use automake's EXTRA_PROGRAMS variable, together with the pdexterns_PROGRAMS automake target, the automake conditional WANT_OBJECT_EXTERNALS, and the C preprocessor macro WANT_OBJECT_EXTERNALS to allow building single-object-externals or multilibs from a single source distribution. should contain something like:

 ##-- always build these externals
 pdexterns_PROGRAMS = hello
 ##-- potential single-object externals (as _PROGRAMS)
 ##-- build single-object externals?
  pdexterns_PROGRAMS += goodbye

If single-object externals were requested by the user, then the C preprocessor macro WANT_OBJECT_EXTERNALS will be defined by autoheader, to allow you to conditionally #include<> the EXTRA_PROGRAMS sources in your top-level multilib source file if desired. In the above example, hello.c might contain:

 # include "config.h"
 /*-- Multilib build: include source for the goodbye external --*/
 # include "goodbye.c"
 /*... local definitions etc. go here ...*/
 void hello_setup(void)
  /*... local setup code goes here ...*/


PD by Miller Puckette and others.


Bryan Jurish <>