aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-benchmark/bonnie/bonnie++/fix-configure-lfs.patch
blob: af20acdcd022440162d2971894f001b00243e8ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Upstream-Status: Submitted [https://salsa.debian.org/etbe/bonnie/-/merge_requests/3/diffs?commit_id=4ffece51791ba75ddca2e664cdce726cc40c92d3]

diff --git i/configure.in w/configure.in
index 080e40c..f2a2bbe 100644
--- i/configure.in
+++ w/configure.in
@@ -82,8 +82,15 @@ void * thread_func(void * param) { return NULL; }
   , thread_ldflags="-lpthread"
   , thread_ldflags="-pthread")
 
-AC_SUBST(large_file)
-AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE
+AC_ARG_ENABLE(lfs,
+      [  --disable-lfs  disable large file support],
+      LFS_CHOICE=$enableval, LFS_CHOICE=check)
+
+if test "$LFS_CHOICE" = yes; then
+   bonniepp_cv_large_file=yes
+elif test "$LFS_CHOICE" = check; then
+   AC_CACHE_CHECK([whether to enable -D_LARGEFILE64_SOURCE], bonniepp_cv_large_file,
+      AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
 #endif
 #include <stdio.h>
@@ -118,8 +125,12 @@ int main () {
   }
   close(fd);
   return 0;
-}], large_file="yes")
-if [[ -n "$large_file" ]]; then
+}], bonniepp_cv_large_file="yes"))
+fi
+
+AC_SUBST(large_file)
+
+if [[ -n "$bonniepp_cv_large_file" ]]; then
    large_file="#define _LARGEFILE64_SOURCE"
 fi