mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #10204 from aabadie/pr/tools/setsid_macosx
tools: build and use setsid command from external source when not available
This commit is contained in:
commit
37fb76b730
@ -570,6 +570,16 @@ define check_cmd
|
||||
exit 1;}
|
||||
endef
|
||||
|
||||
# Check if setsid command is available on the system for debug target
|
||||
# This is not the case on MacOSX, so it must be built on the fly
|
||||
ifneq (,$(filter debug, $(MAKECMDGOALS)))
|
||||
ifneq (0,$(shell which setsid 2>&1 > /dev/null ; echo $$?))
|
||||
SETSID = $(RIOTTOOLS)/setsid/setsid
|
||||
$(call target-export-variables,debug,$(SETSID))
|
||||
DEBUGDEPS += $(SETSID)
|
||||
endif
|
||||
endif
|
||||
|
||||
..compiler-check:
|
||||
$(call check_cmd,$(CC),Compiler)
|
||||
|
||||
@ -643,7 +653,7 @@ list-ttys:
|
||||
doc:
|
||||
make -BC $(RIOTBASE) doc
|
||||
|
||||
debug:
|
||||
debug: $(DEBUGDEPS)
|
||||
$(call check_cmd,$(DEBUGGER),Debug program)
|
||||
$(DEBUGGER) $(DEBUGGER_FLAGS)
|
||||
|
||||
|
6
boards/common/arduino-atmega/dist/debug.sh
vendored
6
boards/common/arduino-atmega/dist/debug.sh
vendored
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
||||
: ${SETSID:=setsid}
|
||||
|
||||
sleep 2
|
||||
setsid -w avarice $1 &
|
||||
${SETSID} -w avarice $1 &
|
||||
#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4
|
||||
sleep 3 && avr-gdb -ex "target remote localhost:$3" $4
|
||||
|
||||
|
6
boards/mega-xplained/dist/debug.sh
vendored
6
boards/mega-xplained/dist/debug.sh
vendored
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
||||
: ${SETSID:=setsid}
|
||||
|
||||
sleep 2
|
||||
setsid -w avarice $1 &
|
||||
${SETSID} -w avarice $1 &
|
||||
#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4
|
||||
sleep 3 && avr-gdb -ex "target remote localhost:$3" $4
|
||||
|
||||
|
6
boards/waspmote-pro/dist/debug.sh
vendored
6
boards/waspmote-pro/dist/debug.sh
vendored
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
||||
: ${SETSID:=setsid}
|
||||
|
||||
sleep 2
|
||||
setsid -w avarice $1 &
|
||||
${SETSID} -w avarice $1 &
|
||||
#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4
|
||||
sleep 3 && avr-gdb -ex "target remote localhost:$3" $4
|
||||
|
||||
|
2
dist/tools/setsid/.gitignore
vendored
Normal file
2
dist/tools/setsid/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
setsid
|
||||
bin
|
17
dist/tools/setsid/Makefile
vendored
Normal file
17
dist/tools/setsid/Makefile
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
PKG_NAME = setsid
|
||||
PKG_URL = https://github.com/tzvetkoff/setsid-macosx
|
||||
PKG_VERSION = e5b851df41591021baf5cf88d4e41572baf8e08b
|
||||
PKG_LICENSE = BSD-2-Clause
|
||||
PKG_BUILDDIR = $(CURDIR)/bin
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: git-download
|
||||
@echo "[INFO] compiling setsid from source now"
|
||||
$(MAKE) BINDIR=$(PKG_BUILDDIR) -C $(PKG_BUILDDIR)
|
||||
@mv $(PKG_BUILDDIR)/setsid $(CURDIR)/setsid
|
||||
|
||||
distclean::
|
||||
@rm -f $(CURDIR)/setsid
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
@ -29,3 +29,8 @@ $(RIOTTOOLS)/mosquitto_rsmb/mosquitto_rsmb:
|
||||
|
||||
mosquitto_rsmb: $(RIOTTOOLS)/mosquitto_rsmb/mosquitto_rsmb
|
||||
@make -C $(RIOTTOOLS)/mosquitto_rsmb run
|
||||
|
||||
$(RIOTTOOLS)/setsid/setsid: $(RIOTTOOLS)/setsid/Makefile
|
||||
@echo "[INFO] setsid binary not found - building it from source now"
|
||||
@make -C $(RIOTTOOLS)/setsid
|
||||
@echo "[INFO] setsid binary successfully build!"
|
||||
|
@ -19,6 +19,7 @@ export USEPKG # Pkg dependencies (third party modules) of the app
|
||||
export DISABLE_MODULE # Used in the application's Makefile to suppress DEFAULT_MODULEs.
|
||||
export APPDEPS # Files / Makefile targets that need to be created before the application can be build. Set in the application's Makefile.
|
||||
# BUILDDEPS # Files / Makefile targets that need to be created before starting to build.
|
||||
# DEBUGDEPS # Files / Makefile targets that need to be created before starting a debug session.
|
||||
|
||||
export RIOTBASE # The root folder of RIOT. The folder where this very file lives in.
|
||||
export RIOTCPU # For third party CPUs this folder is the base of the CPUs.
|
||||
|
Loading…
Reference in New Issue
Block a user