Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
alex9849 committed Feb 9, 2024
2 parents 51e243d + e50c980 commit 9dbbd49
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ git clone $GPIOD_REPO -b $GPIOD_BRANCH $GPIOD_DIRECTORY --single-branch --depth
# ----------------------------------
cd $GPIOD_DIRECTORY

echo -e "INFO: Calling autogen.sh..."
./autogen.sh --enable-tools=no --prefix=$(pwd)/install --host=${HOST}

echo -e "INFO: Calling make clean all install..."
make clean all install \
CROSS_PREFIX=${CROSS_PREFIX} \
CC=$CC \
ARCH=$ARCH

#echo "Copying GPIOD library files to parent 'lib' folder"
echo -e "INFO: Copying GPIOD library files to parent 'lib' folder"
mkdir -p ../lib/${ARCH}/pi4j-gpiod
cp install/lib/libgpiod.so ../lib/${ARCH}/pi4j-gpiod/libgpiod.so
8 changes: 4 additions & 4 deletions libraries/pi4j-library-gpiod/src/main/native/build-libpi4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# #%L
# **********************************************************************
# ORGANIZATION : Pi4J
# PROJECT : Pi4J :: JNI Native Binding Library for PIGPIO
# PROJECT : Pi4J :: JNI Native Binding Library for GPIOD
# FILENAME : build-libpi4j.sh
#
# This file is part of the Pi4J project. More information about
Expand All @@ -29,12 +29,12 @@
###

# ----------------------------------------------
# build latest Pi4J PiGPIO JNI Wrapper Library
# build latest Pi4J GPIOD JNI Wrapper Library
# ----------------------------------------------

echo
echo "============================================================================="
echo " STARTED BUILDING Pi4J-PIGPIO JNI NATIVE LIBRARY: ('${ARCH}/pi4j-gpiod/libpi4j-gpiod')"
echo " STARTED BUILDING Pi4J-GPIOD JNI NATIVE LIBRARY: ('${ARCH}/pi4j-gpiod/libpi4j-gpiod')"
echo "============================================================================="
echo " - FOR ARCHITECTURE : ${ARCH}"
echo " - USING COMPILER : ${CC}"
Expand Down Expand Up @@ -63,6 +63,6 @@ make clean all \

echo
echo "-----------------------------------------------------------------------------"
echo " FINISHED BUILDING Pi4J-PIGPIO JNI NATIVE LIBRARY: ('${ARCH}/libpi4j-gpiod')"
echo " FINISHED BUILDING Pi4J-GPIOD JNI NATIVE LIBRARY: ('${ARCH}/libpi4j-gpiod')"
echo "-----------------------------------------------------------------------------"
echo
61 changes: 39 additions & 22 deletions libraries/pi4j-library-gpiod/src/main/native/build-prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,40 @@
# ----------------------------------
if [ ! -z "`type apt-get 2>/dev/null;`" ]; then

# build-essential
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' build-essential|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install build-essential
else
echo " [PREREQUISITE] 'build-essential' already installed.";
fi

# GCC
GCC_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "" == "$GCC_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install gcc
else
echo " [PREREQUISITE] 'gcc' already installed.";
fi

# GIT
GIT_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "" == "$GIT_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install git
else
echo " [PREREQUISITE] 'git' already installed.";
fi

# TREE
TREE_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "" == "$TREE_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install tree
else
echo " [PREREQUISITE] 'tree' already installed.";
fi

# gcc-arm-linux-gnueabihf
GCC_ARMHF_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-arm-linux-gnueabihf'...";
sudo apt-get --force-yes --yes install gcc-arm-linux-gnueabihf
Expand All @@ -66,7 +74,7 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# gcc-aarch64-linux-gnu
GCC_AARCH64_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-aarch64-linux-gnu'...";
sudo apt-get --force-yes --yes install gcc-aarch64-linux-gnu
Expand All @@ -75,16 +83,16 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# libgpiod2
LIBGPIOD_DEV_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libgpiod-dev)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libgpiod2|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'libgpiod-dev'...";
sudo apt-get --force-yes --yes install libgpiod-dev
echo " [PREREQUISITE] installing 'libgpiod2'...";
sudo apt-get --force-yes --yes install libgpiod2
else
echo " [PREREQUISITE] 'libgpiod-dev' already installed.";
echo " [PREREQUISITE] 'libgpiod2' already installed.";
fi

# libgpiod-dev
LIBGPIOD_2_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libgpiod-dev)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libgpiod-dev|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'libgpiod-dev'...";
sudo apt-get --force-yes --yes install libgpiod-dev
Expand All @@ -93,7 +101,7 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# gpiod
GPIOD_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gpiod)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gpiod|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gpiod'...";
sudo apt-get --force-yes --yes install gpiod
Expand All @@ -102,16 +110,25 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# autoconf
LIBGPIOD_DEV_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' autoconf)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' autoconf|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'autoconf'...";
sudo apt-get --force-yes --yes install autoconf
else
echo " [PREREQUISITE] 'autoconf' already installed.";
fi

# autoconf-archive
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' autoconf-archive|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'autoconf-archive'...";
sudo apt-get --force-yes --yes install autoconf-archive
else
echo " [PREREQUISITE] 'autoconf-archive' already installed.";
fi

# pkg-config
PKG_CONFIG_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' pkg-config)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' pkg-config|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'pkg-config'...";
sudo apt-get --force-yes --yes install pkg-config
Expand All @@ -120,20 +137,20 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# libtool
LIBTOOL_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libtool)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' libtool|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'libtool'...";
sudo apt-get --force-yes --yes install libtool
else
echo " [PREREQUISITE] 'libtool' already installed.";
fi

# autoconf
AUTOCONF_ARCHIVE_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' autoconf-archive)
# pkg-config
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' pkg-config|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'autoconf-archive'...";
sudo apt-get --force-yes --yes install autoconf-archive
echo " [PREREQUISITE] installing 'pkg-config'...";
sudo apt-get --force-yes --yes install pkg-config
else
echo " [PREREQUISITE] 'autoconf-archive' already installed.";
echo " [PREREQUISITE] 'pkg-config' already installed.";
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@
if [ ! -z "`type apt-get 2>/dev/null;`" ]; then

# GCC
GCC_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "" == "$GCC_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install gcc
else
echo " [PREREQUISITE] 'gcc' already installed.";
fi

# GIT
GIT_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "" == "$GIT_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install git
else
echo " [PREREQUISITE] 'git' already installed.";
fi

# TREE
TREE_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "" == "$TREE_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install tree
else
echo " [PREREQUISITE] 'tree' already installed.";
fi

# gcc-arm-linux-gnueabihf
GCC_ARMHF_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-arm-linux-gnueabihf'...";
sudo apt-get --force-yes --yes install gcc-arm-linux-gnueabihf
Expand All @@ -63,7 +63,7 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# gcc-aarch64-linux-gnu
GCC_AARCH64_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-aarch64-linux-gnu'...";
sudo apt-get --force-yes --yes install gcc-aarch64-linux-gnu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,31 @@
if [ ! -z "`type apt-get 2>/dev/null;`" ]; then

# GCC
GCC_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "" == "$GCC_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install gcc
else
echo " [PREREQUISITE] 'gcc' already installed.";
fi

# GIT
GIT_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "" == "$GIT_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' git|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install git
else
echo " [PREREQUISITE] 'git' already installed.";
fi

# TREE
TREE_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "" == "$TREE_INSTALLED" ]]; then
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' tree|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
sudo apt-get --force-yes --yes install tree
else
echo " [PREREQUISITE] 'tree' already installed.";
fi

# gcc-arm-linux-gnueabihf
GCC_ARMHF_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-arm-linux-gnueabihf|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-arm-linux-gnueabihf'...";
sudo apt-get --force-yes --yes install gcc-arm-linux-gnueabihf
Expand All @@ -66,7 +66,7 @@ if [ ! -z "`type apt-get 2>/dev/null;`" ]; then
fi

# gcc-aarch64-linux-gnu
GCC_AARCH64_INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu)
INSTALLED=$(dpkg-query -W --showformat='${Status}\n' gcc-aarch64-linux-gnu|grep "install ok installed")
if [[ "$?" == "1" ]] ; then
echo " [PREREQUISITE] installing 'gcc-aarch64-linux-gnu'...";
sudo apt-get --force-yes --yes install gcc-aarch64-linux-gnu
Expand Down

0 comments on commit 9dbbd49

Please sign in to comment.