Buildroot integration possible using autotools
* Add option to not install a init script
* Added autotools default install prefix
* Add autotools ${DESTDIR} to the install paths
* Add option to specify platform type
This commit is contained in:
committed by
Marcelo Aquino
parent
3570a507a6
commit
0fe9df1a77
@@ -119,21 +119,21 @@ $(CONFIG_FILE):
|
||||
install: all install-gateway install-initscripts
|
||||
|
||||
install-gateway:
|
||||
@echo "Installing $(GATEWAY) to $(GATEWAY_DIR)"
|
||||
@install -m 0755 $(GATEWAY) $(GATEWAY_DIR)
|
||||
@echo "Installing $(GATEWAY) to ${DESTDIR}$(GATEWAY_DIR)"
|
||||
@install -m 0755 $(GATEWAY) ${DESTDIR}$(GATEWAY_DIR)
|
||||
|
||||
install-initscripts:
|
||||
ifeq ($(INIT_SYSTEM), systemd)
|
||||
install -m0644 initscripts/mysgw.systemd /etc/systemd/system/mysgw.service
|
||||
@sed -i -e "s|%gateway_dir%|${GATEWAY_DIR}|g" /etc/systemd/system/mysgw.service
|
||||
install -m0644 initscripts/mysgw.systemd ${DESTDIR}/etc/systemd/system/mysgw.service
|
||||
@sed -i -e "s|%gateway_dir%|${GATEWAY_DIR}|g" ${DESTDIR}/etc/systemd/system/mysgw.service
|
||||
systemctl daemon-reload
|
||||
@echo "MySensors gateway has been installed, to add to the boot run:"
|
||||
@echo " sudo systemctl enable mysgw.service"
|
||||
@echo "To start the gateway run:"
|
||||
@echo " sudo systemctl start mysgw.service"
|
||||
else ifeq ($(INIT_SYSTEM), sysvinit)
|
||||
install -m0755 initscripts/mysgw.sysvinit /etc/init.d/mysgw
|
||||
@sed -i -e "s|%gateway_dir%|${GATEWAY_DIR}|g" /etc/init.d/mysgw
|
||||
install -m0755 initscripts/mysgw.sysvinit ${DESTDIR}/etc/init.d/mysgw
|
||||
@sed -i -e "s|%gateway_dir%|${GATEWAY_DIR}|g" ${DESTDIR}/etc/init.d/mysgw
|
||||
@echo "MySensors gateway has been installed, to add to the boot run:"
|
||||
@echo " sudo update-rc.d mysgw defaults"
|
||||
@echo "To start the gateway run:"
|
||||
|
||||
@@ -14,6 +14,7 @@ Help:
|
||||
Building options:
|
||||
--soc=[BCM2835|BCM2836|AM33XX|A10|A13|A20|H3]
|
||||
SoC type to be used. [configure autodetected]
|
||||
--platform-type=<TYPE> Type of platform
|
||||
--cpu-flags=<CPUFLAGS> CPU defining/optimizing flags to be used. [configure autodetected]
|
||||
--extra-cflags=<CFLAGS> Extra C flags passed to C compilation. []
|
||||
--extra-cxxflags=<CXXFLAGS> Extra C++ flags passed to C++ compilation. []
|
||||
@@ -238,6 +239,9 @@ for opt do
|
||||
--soc=*)
|
||||
SOC="$optarg"
|
||||
;;
|
||||
--platform-type=*)
|
||||
PT="$optarg"
|
||||
;;
|
||||
--cpu-flags=*)
|
||||
CPUFLAGS="$optarg"
|
||||
;;
|
||||
@@ -271,6 +275,12 @@ for opt do
|
||||
--prefix=*)
|
||||
PREFIX="$optarg"
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
PREFIX="$optarg"
|
||||
;;
|
||||
--no_init_system*)
|
||||
NO_INIT="1"
|
||||
;;
|
||||
--gateway-dir=*)
|
||||
GATEWAY_DIR="$optarg"
|
||||
;;
|
||||
@@ -403,6 +413,10 @@ if [ -z "${SOC}" ]; then
|
||||
echo "[OK] machine detected: SoC=${SOC}, Type=${TYPE}, CPU=${CPU}, REV=${REV}."
|
||||
fi
|
||||
|
||||
if [ "${PT}" ]; then
|
||||
TYPE=${PT}
|
||||
fi
|
||||
|
||||
if [ -z "${CPUFLAGS}" ]; then
|
||||
CPUFLAGS=$(gcc_cpu_flags $SOC)
|
||||
fi
|
||||
@@ -466,7 +480,9 @@ fi
|
||||
LDFLAGS="-pthread $LDFLAGS"
|
||||
CPPFLAGS="$CPUFLAGS $CPPFLAGS"
|
||||
|
||||
if [ -x /usr/bin/systemctl ] || [ -x /bin/systemctl ]; then
|
||||
if [ "${NO_INIT}" ]; then
|
||||
echo "[OK] no init system chosen."
|
||||
elif [ -x /usr/bin/systemctl ] || [ -x /bin/systemctl ]; then
|
||||
INIT_SYSTEM=systemd
|
||||
echo "[OK] init system detected: systemd"
|
||||
elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
|
||||
|
||||
Reference in New Issue
Block a user