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

Igor2 igor2 at inno.bme.hu
Mon Oct 9 02:33:08 EDT 2006


On Mon, 9 Oct 2006, DJ Delorie wrote:

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

Yup, this why I tried this approach for the first as well :)

>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).

Yeah, the naming was random, if you prefer it without D and with _, I can
write a new patch today. About the config side: I do want to avoid
autoconf/automake in my porjects and also there's an option that the user
has changed the prefixes when compiling pcb. On code level with the global
vars I can handle that, on config/make level I will probably need some
tricking (see later).

>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.

Thanx, good idea.

>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).

Yup, but would help the config of the modules. So what about having the
global variables for the data I really need runtime, with the proper
naming, then I write a tiny external hid that just prints all the prefixes
needed for the config process. The config would run "pcb -x config". The
only problematic part is that we should be able to bypass the normal
external hid loading mechanism of pcb since we don't know about the system
dirs and $HOME may be invalid as well. Just an idea, maybe not the right
one :)




More information about the geda-dev mailing list