gEDA-dev: [pcb] patch: export some compile-time options (for external HIDs)

DJ Delorie dj at delorie.com
Mon Oct 9 01:08:13 EDT 2006


Global variables seem to be the best option; I don't like the thought
of adding an API for these.

I don't think Dfoo is a good naming scheme though.  Dexecprefixdir
should be exec_prefix_dir, host could be host_type_name
(traditionally, it's called a "host tuple" or "host triplet").  What
are you using these for?  You might need prefix instead of
exec-prefix, and your build should already know HOST.  (in theory, an
autoconf-run build should know execprefix too).

You shouldn't need Dmax_layer, use PCB->Data->LayerN.  MAX_LAYER is a
compile-time upper limit to the number of layers; if you're
dynamically allocating memory anyway, just allocate the current number
of layers.  If you need a compile-time constant, use the MAX_LAYER
that's #defined in globalconst.h.

Another option is to have an option for pcb that prints to stdout a .h
fragment that modules can use to build.  Doesn't help make them more
dynamic though (i.e. pre-built modules won't adapt to new pcb
binaries).


More information about the geda-dev mailing list