X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <20230323162813.11208.qmail@stuge.se> Date: Thu, 23 Mar 2023 16:28:13 +0000 From: "Peter Stuge (peter AT stuge DOT se) [via geda-user AT delorie DOT com]" To: geda-user AT delorie DOT com Subject: Re: [geda-user] lepton-sch2pcb: wrong ${prefix} for pcb References: <20230319121903 DOT 84DEA8497641 AT turkos DOT aspodata DOT se> <20230321224848 DOT D85CA8497643 AT turkos DOT aspodata DOT se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230321224848.D85CA8497643@turkos.aspodata.se> Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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