summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2022-05-20 09:52:54 +0200
committerJaroslav Kysela <perex@perex.cz>2022-05-20 09:55:17 +0200
commita513e65e1919d9cd4df5e43f595414e5cf16270e (patch)
treee06553d00ad878e2b4abee56306cd3e1e024bceb
parent4fb83669ef5871222dc633f091a7a5ec4d9688f4 (diff)
downloadalsa-lib-a513e65e1919d9cd4df5e43f595414e5cf16270e.tar.gz
configure: add --with-lfs option
We are forcibly use the LFS (64-bit) calls in the source now. Add a new check to the configure script and use compatibility defines when those calls are not available for a reason. Fixes: https://github.com/alsa-project/alsa-lib/pull/223 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--configure.ac20
-rw-r--r--include/local.h10
2 files changed, 30 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2d780788..d7e7653d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,26 @@ if test "$softfloat" != "yes"; then
ALSA_DEPLIBS="-lm"
fi
+dnl Check for scandir64
+AC_MSG_CHECKING(for LFS calls)
+lfs=
+AC_ARG_WITH(lfs,
+ AS_HELP_STRING([--with-lfs], [Use LFS calls (default = yes)]),
+ [ have_lfs="$withval" ], [ have_lfs="yes" ])
+HAVE_LIBDL=
+if test "$have_lfs" = "yes"; then
+ AC_TRY_LINK([#include <dirent.h>],
+ [struct dirent64 a; ],
+ [have_lfs=yes],
+ [have_lfs=no])
+fi
+if test "$have_lfs" = "yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_LFS], 1, [Have LFS])
+else
+ AC_MSG_RESULT(no)
+fi
+
dnl Check for libdl
AC_MSG_CHECKING(for libdl)
AC_ARG_WITH(libdl,
diff --git a/include/local.h b/include/local.h
index f64fe9d8..51fa4063 100644
--- a/include/local.h
+++ b/include/local.h
@@ -76,6 +76,16 @@
#error "Unsupported endian..."
#endif
+#ifndef HAVE_LFS
+#define stat64 stat
+#define lstat64 lstat
+#define dirent64 dirent
+#define readdir64 readdir
+#define scandir64 scandir
+#define versionsort64 versionsort
+#define alphasort64 alphasort
+#endif
+
#define _snd_config_iterator list_head
#define _snd_interval snd_interval
#define _snd_pcm_info snd_pcm_info