Added legacy option for systems with older linux headers

This commit is contained in:
Melissa LeBlanc-Williams 2020-08-11 18:47:07 -07:00
parent 30c45ecef3
commit fe48a15f6c

View file

@ -6,6 +6,21 @@
# chmod +x libgpiod.sh # chmod +x libgpiod.sh
# ./libgpiod.sh # ./libgpiod.sh
is_legacy=0
# Loop through arguments and process them
for arg in "$@"
do
case $arg in
-l|--legacy)
is_legacy=1
shift
;;
*)
shift
;;
esac
done
echo "Installing build requirements - this may take a few minutes!" echo "Installing build requirements - this may take a few minutes!"
echo echo
@ -35,6 +50,11 @@ echo
cd "$build_dir" cd "$build_dir"
git clone git://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git . git clone git://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git .
if test $is_legacy = 1; then
git checkout v1.4.2 -b v1.4.2
fi
echo "Building libgpiod" echo "Building libgpiod"
echo echo