Mail Archives: geda-user/2023/03/23/12:48:53
karl AT aspodata DOT se [via geda-user AT delorie DOT com] wrote:
> In m4/pcb-data-dirs.m4, after some preamble, there is:
> PCBDATADIR="${datarootdir}/pcb"
I think this file is only used during configure of lepton/geda-gaf.
> The first line of which says:
> "The following variables specify the directories for package installation,"
> which has noting to do with wherever pcb is installed
> or where pcb's files are.
I agree. I guess this is a leftover from when gschem+pcb were more
tightly coupled.
> The point of having the pcb-data-dirs.m4 file seems to allow
> the user to change the default or what autoconf can find out
> itself.
Project-specific m4 files are used to add project-specific behavior
or m4 macros to be used by or included in the configure script so
yes, in particular the AC_ARG_WITH([pcb-datadir], block adds an
option --with-pcb-datadir to configure, which allows setting the
PCB datadir explicitly at geda-gaf configure time.
> I suggest that the variable datarootdir in this file be
> replaced whith something like "dirname $(dirname $(which pcb))".
That would create a new ordering dependency (pcb must be installed
before geda-gaf can be built) and in general create a build
environment dependency (pcb must be installed for building geda-gaf),
both of which are quite undesirable.
It's already not good practice to make a software build depend or
rely on particulars within the build environment, adding in a
dependency on the PATH used at time of configure even less so.
Unfortunately I don't think there's any good heuristic to recognize
the correct directory, otherwise it might be possible to add some
autodetect logic, perhaps searching a list of some common paths and
failing with an error message if nothing satisfactory was found.
However, m4/pcb-data-dir.sm4 in geda-gaf says after the license comment:
# Check where to look for PCB footprints.
# FIXME All of this should be done at runtime.
..soo..
> Crude patch attached, but it should be easy doing this directly in
> the running code.
..perhaps the time has come to move this to runtime now? :)
Kind regards
//Peter
- Raw text -