commit: 85835133a4c2cd5a224bb91f2ba938e19d6a1317
parent ca895e0a9a3326c49d58c501ff0790456f2507d5
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 1 Aug 2025 05:07:22 +0200
configure: disable cmd/ln if <fcntl.h> doesn't defines O_PATH
Diffstat:
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
@@ -266,6 +266,11 @@ fi
check_conftest configure.d/mkstemps.c && cpp_define HAS_MKSTEMPS
check_conftest configure.d/mkdtemps.c && cpp_define HAS_MKDTEMPS
+if ! check_conftest configure.d/o_path.c; then
+ echo 'Disabling cmd/ln'
+ target_filter="${target_filter} -e cmd/ln."
+fi
+
rm -f configure.d/*.bin
echo
diff --git a/configure.d/o_path.c b/configure.d/o_path.c
@@ -0,0 +1,13 @@
+#define _DEFAULT_SOURCE
+#include <fcntl.h>
+
+#ifndef O_PATH
+#error Macro O_PATH undefined
+#endif
+
+int
+main(void)
+{
+ int flag = O_PATH;
+ return flag > 0;
+}