From 7a5eaac4b272a72ecabb951b4e164a133b4003a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Thu, 4 Oct 2018 14:24:13 +0200 Subject: [PATCH 1/5] Add epicsextfinddist.sh Add a script to find out which Linux Distribution we are running on. The script will be used in the next commit, and possibly from medm. Currently Debian and Raspbian are supported, more distros may be add later, and in different commits. --- epicsextfinddist.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 epicsextfinddist.sh diff --git a/epicsextfinddist.sh b/epicsextfinddist.sh new file mode 100755 index 0000000..cd9c290 --- /dev/null +++ b/epicsextfinddist.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Find out the Linux distribution +# Ideas stolen from here: +# https://github.com/jeonghanlee/pkg_automation/blob/master/pkg_automation.bash + +if [ -x /usr/bin/lsb_release ] ; then + dist_id=$(lsb_release -is) + dist_cn=$(lsb_release -cs) + dist_rs=$(lsb_release -rs) + tmpdist=$dist_id${dist_cn}${dist_rs} +elif [ -r /usr/bin/lsb_release ] ; then + eval $(grep "^ID=" /etc/os-release) + eval $(grep "^VERSION_ID=" /etc/os-release) + tmpdist=$ID$VERSION_ID +else + tmpdist=Unknown +fi + +case "$tmpdist" in + [dD]ebian*8*) + echo Debian8 + ;; + [dD]ebian*9*) + echo Debian9 + ;; + Raspbian.*8*) + echo Raspbian8 + ;; + Raspbian.*9*) + echo Raspbian9 + ;; + *) + echo Unsupported + ;; +esac From 772ab2777eb6a62c6419b351bca039310b209e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Thu, 4 Oct 2018 14:26:41 +0200 Subject: [PATCH 2/5] Find X11 and Motif for Debian x86_64 Use the epicsextfinddist.sh to set X11 and Motif locations for Debian 8/9. More distros may be added later, in different commits --- .../os/CONFIG_SITE.linux-x86_64.linux-x86_64 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 index 8179885..31730b9 100644 --- a/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 +++ b/configure/os/CONFIG_SITE.linux-x86_64.linux-x86_64 @@ -43,6 +43,21 @@ SCIPLOT=YES #MOTIF_LIB=/usr/lib #MOTIF_INC=/usr/include +LINUX_DISTRO = $(shell sh -c '$(TOP)/epicsextfinddist.sh || echo PWD=$$PWD TOP=$(TOP)') + +ifeq ($(shell expr "$(LINUX_DISTRO)" : 'Debian[89]'),7) + X11_LIB=/usr/lib/x86_64-linux-gnu/ + X11_INC=/usr/include + MOTIF_LIB=/usr/lib/x86_64-linux-gnu + MOTIF_INC=/usr/include +endif + +build: echolinuxdistro + +echolinuxdistro: + @echo Info from CONFIG_SITE.linux-x86_64.linux-x86_64: LINUX_DISTRO=$(LINUX_DISTRO) + + # Ubuntu 12 64-bit is at Python 2.6 #PYTHON_DIR=/usr/lib/python2.6 #PYTHON_INCLUDE=/usr/include/python2.6 From 75684a45ec9ea1361dac2ee3932fe7273def5c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Thu, 4 Oct 2018 14:28:52 +0200 Subject: [PATCH 3/5] Make it possible to use configure/CONFIG_SITE.local Enhace configure/CONFIG_SITE to optionally include a local file to override local settings. This allows tweaks without touching configure/CONFIG_SITE itself, which is tracked under version control. --- configure/CONFIG_SITE | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 5ac123e..99b355f 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -18,3 +18,9 @@ CROSS_COMPILER_TARGET_ARCHS = # Extensions don't normally build shared libraries SHARED_LIBRARIES = NO +# These allow developers to override the CONFIG_SITE variable +# settings without having to modify the configure/CONFIG_SITE +# file itself. +-include $(TOP)/../CONFIG_SITE.local +-include $(TOP)/configure/CONFIG_SITE.local + From 86b17412eaf2408af9be0bb2035756e87ab34b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Thu, 4 Oct 2018 14:31:22 +0200 Subject: [PATCH 4/5] Make it possible to use configure/RWLEASE.local Enhace configure/RELEASE to optionally include a local file to override local settings. This allows tweaks without touching configure/RELEASE itself, which is tracked under version control. --- configure/RELEASE | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure/RELEASE b/configure/RELEASE index 9363e55..6f29558 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -23,3 +23,11 @@ EPICS_BASE=$(TOP)/../base EPICS_EXTENSIONS=$(TOP) OAG_APPS=$(TOP)/../../oag/apps + + + +# These allow developers to override the RELEASE variable settings +# without having to modify the configure/RELEASE file itself. +-include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local + From 1b4a38ebca168a3f28f7ecd4d705132a4f25b6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Wed, 15 Mar 2023 18:29:49 +0100 Subject: [PATCH 5/5] Loosen epicsextfinddist.sh a little bit Make the script to find the raspian version more tolerant --- epicsextfinddist.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epicsextfinddist.sh b/epicsextfinddist.sh index cd9c290..7022ebf 100755 --- a/epicsextfinddist.sh +++ b/epicsextfinddist.sh @@ -23,13 +23,13 @@ case "$tmpdist" in [dD]ebian*9*) echo Debian9 ;; - Raspbian.*8*) + Raspbian*8*) echo Raspbian8 ;; - Raspbian.*9*) + Raspbian*9*) echo Raspbian9 ;; *) - echo Unsupported + echo Unsupported $tmpdist ;; esac