All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] meson: allow use of installed uapi headers
@ 2022-03-02 23:34 Evan Gates
  2022-03-04 18:28 ` Philippe Gerum
  2022-03-04 19:02 ` [PATCH v2] " Evan Gates
  0 siblings, 2 replies; 7+ messages in thread
From: Evan Gates @ 2022-03-02 23:34 UTC (permalink / raw)
  To: xenomai

Commit c70a9d9d536aefcf6574328aaac0fcc86f9ab0f7 added a test for
$UAPI/include/uapi/evl that was meant to ensure the given $UAPI path was
correct.  That test meant that $UAPI had to point to a linux-evl source
directory and could not point to installed headers in e.g. /usr/include.
The script had previously allowed the use of installed headers, using
the existence of $UAPI/Kbuild as an hueristic to decide whether $UAPI
pointed to linux-evl source or to installed headers.

Rewrite the script to check for the existence of all three required
directories (asm, asm-generic, evl) in two possible locations ($UAPI,
$UAPI/include/uapi).  This once again allows the use of installed headers,
and gets rid of the heuristic, instead testing for the actual directories.

Fixes: c70a9d9 (build: tighten consistency check for uapi)
---
 meson/setup-uapi.sh | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/meson/setup-uapi.sh b/meson/setup-uapi.sh
index 1b43c02..bb96e86 100644
--- a/meson/setup-uapi.sh
+++ b/meson/setup-uapi.sh
@@ -1,19 +1,17 @@
 #! /bin/sh
 
-if test \! -d $UAPI/include/uapi/evl; then
-    echo "meson: path given to -Duapi does not look right ($UAPI/include/uapi/evl is missing)"
-    exit 1
-fi
+set evl asm asm-generic
 
-mkdir -p $O_UAPI
-rm -f $O_UAPI/asm $O_UAPI/asm-generic $O_UAPI/evl
+for uapi in $UAPI/include/uapi $UAPI; do
+	for d do test -d $uapi/$d || continue 2; done
+	found=1
+	break
+done
 
-if test -r $UAPI/Kbuild; then
-    ln -s $UAPI/arch/$ARCH/include/uapi/asm $O_UAPI/asm
-    ln -s $UAPI/include/uapi/asm-generic $O_UAPI/asm-generic
-    ln -s $UAPI/include/uapi/evl $O_UAPI/evl
-elif test \! -L	$O_UAPI/asm; then
-    ln -s $UAPI/asm $O_UAPI/asm
-    ln -s $UAPI/asm-generic $O_UAPI/asm-generic
-    ln -s $UAPI/evl $O_UAPI/evl
+if [ ! "$found" ]; then
+	echo meson: path given to -Duapi does not look right
+	exit 1
 fi
+
+mkdir -p $O_UAPI
+for d do ln -sf $uapi/$d $O_UAPI/$d; done
-- 
2.33.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-10  9:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 23:34 [PATCH] meson: allow use of installed uapi headers Evan Gates
2022-03-04 18:28 ` Philippe Gerum
2022-03-04 18:35   ` Evan Gates
2022-03-04 19:02 ` [PATCH v2] " Evan Gates
2022-03-05 10:11   ` Philippe Gerum
2022-03-07 18:31   ` [PATCH v3] " Evan Gates
2022-03-10  9:50     ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.