Skip to content

Commit 28a2c78

Browse files
committed
Added special default directories to work with fpcupdeluxe
1 parent dfdac1b commit 28a2c78

3 files changed

Lines changed: 45 additions & 7 deletions

File tree

buildtools.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ buildopenocdrp2040() {
234234
git clone https://github.com/raspberrypi/openocd.git --branch picoprobe --depth=1 openocd-rp2040
235235
cd $OPENOCDRP2040VERSION
236236

237+
patch -p1 <../patches/openocd-rp2040-fpcupspecialpath.patch
238+
237239
./bootstrap 2>&1 | $PV --name="Bootstrap" --line-mode --size 44 >/dev/null
238240

239241
mkdir build
@@ -257,11 +259,11 @@ buildopenocdrp2040() {
257259
strip $INSTALLDIR/${file}-rp2040
258260
[ -n "$HOSTISDARWIN" ] && codesign -f -o runtime --timestamp -s 'Developer ID Application: Michael Ring (4S7HMLQE4Z)' $INSTALLDIR/${file}-rp2040
259261
done
260-
mkdir -p $INSTALLDIR/../share/openocd/scripts/{board,interface,target}
261-
cp $BUILDDIR/usr/local/share/openocd/scripts/interface/picoprobe.cfg $INSTALLDIR/../share/openocd/scripts/interface/
262-
cp $BUILDDIR/usr/local/share/openocd/scripts/target/rp2040*.cfg $INSTALLDIR/../share/openocd/scripts/target/
263-
cp $BUILDDIR/usr/local/share/openocd/scripts/target/swj-dp*.tcl $INSTALLDIR/../share/openocd/scripts/target/
264-
cat >$INSTALLDIR/../share/openocd/scripts/board/pico.cfg <<EOF
262+
mkdir -p $INSTALLDIR/../../share/openocd/scripts/{board,interface,target}
263+
cp $BUILDDIR/usr/local/share/openocd/scripts/interface/picoprobe.cfg $INSTALLDIR/../../share/openocd/scripts/interface/
264+
cp $BUILDDIR/usr/local/share/openocd/scripts/target/rp2040*.cfg $INSTALLDIR/../../share/openocd/scripts/target/
265+
cp $BUILDDIR/usr/local/share/openocd/scripts/target/swj-dp*.tcl $INSTALLDIR/../../share/openocd/scripts/target/
266+
cat >$INSTALLDIR/../../share/openocd/scripts/board/pico.cfg <<EOF
265267
source [find interface/picoprobe.cfg]
266268
source [find target/RP2040.cfg]
267269
EOF
@@ -289,6 +291,8 @@ buildopenocd() {
289291
git clone https://github.com/ntfreak/openocd.git openocd-0.11.0-rc2
290292
cd $OPENOCDVERSION
291293

294+
patch -p1 <../patches/openocd-fpcupspecialpath.patch
295+
292296
./bootstrap 2>&1 | $PV --name="Bootstrap" --line-mode --size 42 >/dev/null
293297

294298
mkdir build
@@ -312,8 +316,8 @@ buildopenocd() {
312316
strip $INSTALLDIR/${file}
313317
[ -n "$HOSTISDARWIN" ] && codesign -f -o runtime --timestamp -s 'Developer ID Application: Michael Ring (4S7HMLQE4Z)' $INSTALLDIR/${file}
314318
done
315-
mkdir -p $INSTALLDIR/../share/openocd
316-
cp -r $BUILDDIR/usr/local/share/openocd $INSTALLDIR/../share/
319+
mkdir -p $INSTALLDIR/../../share/openocd
320+
cp -r $BUILDDIR/usr/local/share/openocd $INSTALLDIR/../../share/
317321
rm -rf $BUILDDIR/usr
318322
)
319323
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/src/helper/options.c b/src/helper/options.c
2+
index 0ccbf5642..0d2af91f2 100644
3+
--- a/src/helper/options.c
4+
+++ b/src/helper/options.c
5+
@@ -269,6 +269,12 @@ static void add_default_dirs(void)
6+
free(path);
7+
}
8+
9+
+ path = alloc_printf("%s/../%s/%s", exepath, bin2data, "scripts");
10+
+ if (path) {
11+
+ add_script_search_dir(path);
12+
+ free(path);
13+
+ }
14+
+
15+
free(exepath);
16+
free(bin2data);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/src/helper/options.c b/src/helper/options.c
2+
index 0ccbf56..0d2af91 100644
3+
--- a/src/helper/options.c
4+
+++ b/src/helper/options.c
5+
@@ -269,6 +269,12 @@ static void add_default_dirs(void)
6+
free(path);
7+
}
8+
9+
+ path = alloc_printf("%s/../%s/%s", exepath, bin2data, "scripts");
10+
+ if (path) {
11+
+ add_script_search_dir(path);
12+
+ free(path);
13+
+ }
14+
+
15+
free(exepath);
16+
free(bin2data);
17+
}

0 commit comments

Comments
 (0)