X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7+dev X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: inbox From: "karl AT aspodata 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 In-reply-to: <20230319121903.84DEA8497641@turkos.aspodata.se> References: <20230319121903 DOT 84DEA8497641 AT turkos DOT aspodata DOT se> Comments: In-reply-to "karl AT aspodata DOT se [via geda-user AT delorie DOT com]" message dated "Sun, 19 Mar 2023 13:19:03 +0100." Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_1679438018_3450" Message-Id: <20230321224848.D85CA8497643@turkos.aspodata.se> Date: Tue, 21 Mar 2023 23:48:48 +0100 (CET) X-Virus-Scanned: ClamAV using ClamSMTP 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 -rw-r--r-- 1 karl users 3718 Mar 1 2021 /usr/local/share/pcb/m4/common.m4 This is a multipart MIME message. --==_Exmh_1679438018_3450 Content-Type: text/plain In m4/pcb-data-dirs.m4, after some preamble, there is: PCBDATADIR="${datarootdir}/pcb" According to page 41 in: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.pdf one can see that datarootdir is listed under section "4.8.2 Installation Directory Variables". 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. So datarootdir has to be replaced whith something else. 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. I suggest that the variable datarootdir in this file be replaced whith something like "dirname $(dirname $(which pcb))". Crude patch attached, but it should be easy doing this directly in the running code. ///////// On boxA: $ dir=$(dirname $(dirname $(which pcb))) $ ls -l $dir/share/pcb/m4/common.m4 $ lepton-sch2pcb styrkort.sch [...] ===================================================== gsch2pcb backend configuration: ---------------------------------------- Variables which may be changed in gafrc: ---------------------------------------- gsch2pcb:pcb-m4-command: "/usr/bin/m4" gsch2pcb:pcb-m4-dir: "/usr/local/share/pcb/m4" gsch2pcb:pcb-m4-path: ("$HOME/.pcb" ".") gsch2pcb:m4-files: "" --------------------------------------------------- Variables which may be changed in the project file: --------------------------------------------------- gsch2pcb:use-m4: yes ---------------- M4 command line: ---------------- /usr/bin/m4 -d -I/usr/local/share/pcb/m4 -I$HOME/.pcb -I. /usr/local/share/pcb/m4/common.m4 - ===================================================== Using the m4 processor for pcb footprints [...] ///////// On boxB: $ dir=$(dirname $(dirname $(which pcb))) $ ls -l $dir/share/pcb/m4/common.m4 -rw-r--r-- 1 root root 3718 Feb 3 2019 /usr/share/pcb/m4/common.m4 $ $ lepton-sch2pcb styrkort.sch [...] ===================================================== gsch2pcb backend configuration: ---------------------------------------- Variables which may be changed in gafrc: ---------------------------------------- gsch2pcb:pcb-m4-command: "/usr/bin/m4" gsch2pcb:pcb-m4-dir: "/usr/share/pcb/m4" gsch2pcb:pcb-m4-path: ("$HOME/.pcb" ".") gsch2pcb:m4-files: "" --------------------------------------------------- Variables which may be changed in the project file: --------------------------------------------------- gsch2pcb:use-m4: yes ---------------- M4 command line: ---------------- /usr/bin/m4 -d -I/usr/share/pcb/m4 -I$HOME/.pcb -I. /usr/share/pcb/m4/common.m4 - ===================================================== Using the m4 processor for pcb footprints /usr/bin/m4: cannot open `': No such file or directory [...] ///////// Don't know what the last line is about. it isn't there on boxA. On boxA I get lots of: find_element can't open dir "Grid[10000.000000 0 0 0] ": No such file or directory find_element can't open dir "`e0?": No such file or directory find_element can't open dir "??0?": No such file or directory find_element can't open dir "^^.?": No such file or directory find_element can't open dir "C ": No such file or directory find_element can't open dir "?D.?": No such file or directory yR2: can't find PCB element for footprint ipc7351b_1608Ar.fp (value=10k) So device yR2 will not be in the layout. but only the first time the command is run, strange. Regards, /Karl Hammar --==_Exmh_1679438018_3450 Content-Type: text/plain; charset="utf-8" ; name="patch" Content-Description: patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch" diff --git a/m4/pcb-data-dirs.m4 b/m4/pcb-data-dirs.m4 index caee1e0f5..1d57d6693 100644 --- a/m4/pcb-data-dirs.m4 +++ b/m4/pcb-data-dirs.m4 @@ -27,7 +27,9 @@ AC_DEFUN([AX_PCB_DIRS], = # Check what prefix to use for PCB footprint libraries AC_MSG_CHECKING([where to look for PCB footprints]) - PCBDATADIR=3D"${datarootdir}/pcb" + + dir=3Dm4_esyscmd_s([dirname $(dirname $(which pcb) )]) + PCBDATADIR=3D"${dir}/share/pcb" AC_ARG_WITH([pcb-datadir], AS_HELP_STRING([--with-pcb-datadir=3DDIR], [search for PCB libraries in DIR [[DATAROOTDIR/pcb]]]), --==_Exmh_1679438018_3450--