aboutsummaryrefslogtreecommitdiffstats
path: root/conf/m4/plptools/PLP_FIND_CDEV.m4
diff options
context:
space:
mode:
Diffstat (limited to 'conf/m4/plptools/PLP_FIND_CDEV.m4')
-rw-r--r--conf/m4/plptools/PLP_FIND_CDEV.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/conf/m4/plptools/PLP_FIND_CDEV.m4 b/conf/m4/plptools/PLP_FIND_CDEV.m4
new file mode 100644
index 0000000..557d7e9
--- /dev/null
+++ b/conf/m4/plptools/PLP_FIND_CDEV.m4
@@ -0,0 +1,17 @@
+dnl
+dnl Select first existing char device from a list of given devices
+dnl Usage:
+dnl PLP_FIND_CDEV(/dev/tty1 /dev/tty2 /dev/console, FOUND)
+dnl
+dnl On return, variable FOUND is set to one of the devices or to NO, if none
+dnl was found.
+dnl
+AC_DEFUN(PLP_FIND_CDEV,[
+ $2=NO
+ for i in $1; do
+ if test -c "$i" ; then
+ $2=$i
+ break 2
+ fi
+ done
+])