Skip to content
Snippets Groups Projects
Commit c3d4d72f authored by Benedikt Meurer's avatar Benedikt Meurer
Browse files

2006-07-27 Benedikt Meurer <benny@xfce.org>

	* configure.in.in, thunar-vfs/thunar-vfs-io-local-xfer.c,
	  tdb/Makefile.am: Work-around various glibc oddities.




(Old svn revision: 22536)
parent 451885e6
No related branches found
No related tags found
No related merge requests found
2006-07-27 Benedikt Meurer <benny@xfce.org>
* configure.in.in, thunar-vfs/thunar-vfs-io-local-xfer.c,
tdb/Makefile.am: Work-around various glibc oddities.
2006-07-27 Benedikt Meurer <benny@xfce.org>
* README, acinclude.m4, configure.in.in, thunar-vfs/, thunar/,
......
......@@ -96,6 +96,8 @@ AC_MSG_RESULT([$TDB_U32_TYPE])
dnl ***********************************************
dnl *** Work-around system-specific limitations ***
dnl ***********************************************
AC_DEFINE([_XOPEN_SOURCE], [600], [Required to make glibc usable])
AC_DEFINE([_BSD_SOURCE], [1], [Required to make glibc usable])
AC_SYS_LARGEFILE()
dnl **********************************
......@@ -114,73 +116,9 @@ dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
AC_CHECK_FUNCS([attropen extattr_get_fd fgetxattr lchmod localeconv \
localtime_r mbrtowc mkfifo pread pwrite readdir_r \
sched_yield setgroupent setpassent statfs statvfs strcoll \
strlcpy symlink])
dnl ***************************************
dnl *** Check for working posix_madvise ***
dnl ***************************************
m4_define([posix_madvise_test],
[
posix_madvise (0, 0, POSIX_MADV_NORMAL);
posix_madvise (0, 0, POSIX_MADV_SEQUENTIAL);
posix_madvise (0, 0, POSIX_MADV_RANDOM);
posix_madvise (0, 0, POSIX_MADV_WILLNEED);
posix_madvise (0, 0, POSIX_MADV_DONTNEED);
])
AC_MSG_CHECKING([for working posix_madvise])
AC_TRY_LINK([#include <sys/mman.h>], posix_madvise_test(),
[
AC_DEFINE([HAVE_POSIX_MADVISE], [1], [Define if posix_madvise is working])
AC_MSG_RESULT([yes])
],
[
dnl As usual, Linux/glibc doesn't work properly out-of-the-box
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D__USE_XOPEN2K"
AC_TRY_LINK([#include <sys/mman.h>], posix_madvise_test(),
[
AC_DEFINE([HAVE_POSIX_MADVISE], [1], [Define if posix_madvise is working])
AC_MSG_RESULT([yes])
],
[
CPPFLAGS="$ac_save_CPPFLAGS"
AC_MSG_RESULT([no])
])
])
dnl **********************************
dnl *** Check for working strptime ***
dnl **********************************
if test x"$GCC" = x"yes"; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror" # to detect a protected declaration
m4_define([strptime_test], [ strptime (0, 0, 0); ])
AC_MSG_CHECKING([for working strptime])
AC_TRY_LINK([#include <time.h>], strptime_test,
[
AC_DEFINE([HAVE_STRPTIME], [1], [Define if strptime is working])
AC_MSG_RESULT([yes])
],
[
dnl As usual, Linux/glibc doesn't work properly out-of-the-box
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D__USE_XOPEN"
AC_TRY_LINK([#include <time.h>], strptime_test,
[
AC_DEFINE([HAVE_STRPTIME], [1], [Define if strptime is working])
AC_MSG_RESULT([yes])
],
[
CPPFLAGS="$ac_save_CPPFLAGS"
AC_MSG_RESULT([no])
])
])
CFLAGS="$ac_save_CFLAGS"
else
AC_CHECK_FUNCS([strptime])
fi
localtime_r mbrtowc mkfifo posix_madvise pread pwrite \
readdir_r sched_yield setgroupent setpassent statfs \
statvfs strcoll strlcpy strptime symlink])
dnl ******************************
dnl *** Check for i18n support ***
......
......@@ -7,9 +7,6 @@ INCLUDES = \
noinst_LTLIBRARIES = \
libtdb.la
libtdb_la_CFLAGS = \
-D_XOPEN_SOURCE=500
libtdb_la_SOURCES = \
spinlock.c \
spinlock.h \
......
......@@ -200,7 +200,7 @@ tvilx_copy_regular (const gchar *source_absolute_path,
{
#ifdef HAVE_POSIX_MADVISE
/* tell the system that the data will be read sequentially */
posix_madvise (buffer, source_statb->st_size, MADV_SEQUENTIAL);
posix_madvise (buffer, source_statb->st_size, POSIX_MADV_SEQUENTIAL);
#endif
/* write the data to the target file */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment