AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-AC_ISC_POSIX
+
+AC_CONFIG_HEADERS([config.h])
+AH_TOP([
+#ifndef EFL_CONFIG_H__
+#define EFL_CONFIG_H__
+])
+AH_BOTTOM([
+#endif /* EFL_CONFIG_H__ */
+])
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
-AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_GNU_SOURCE
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_rev:lt_cur:lt_age"
release_info="v_rel"
-AC_SUBST(version_info)
-AC_SUBST(release_info)
+AC_SUBST([version_info])
+AC_SUBST([release_info])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
-AC_SUBST(VMAJ)
+AC_SUBST([VMAJ])
+
+
+### Needed information
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+
+
+### Default options with respect to host
-# options
want_inotify="no"
want_notify_win32="no"
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
want_notify_win32="yes"
;;
*)
;;
esac
-dnl we just have set the version info, then:
-AC_SUBST(version_info)
+
+### Checks for programs
AC_PROG_CC
+
# pkg-config
PKG_PROG_PKG_CONFIG
else
pkgconfig_requires_private="Requires"
fi
-AC_SUBST(pkgconfig_requires_private)
-
-AC_SUBST(requirements_eio)
+AC_SUBST([pkgconfig_requires_private])
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
+
### Checks for libraries
requirements_eio="eet >= 1.6.0 eina >= 1.2.0 ecore >= 1.2.0"
+AC_SUBST([requirements_eio])
PKG_CHECK_MODULES([EIO], [${requirements_eio}])
+
### Checks for header files
+
AC_HEADER_DIRENT
AC_HEADER_TIME
-AC_CHECK_HEADERS([grp.h])
+AC_CHECK_HEADERS([unistd.h libgen.h grp.h features.h pwd.h])
+
EFL_CHECK_THREADS(
[
if test "x${_efl_have_posix_threads}" = "xyes" ; then
### Checks for structures
-### Checks for linker characteristics
-
-# use --enable-auto-import on Windows
-
-lt_enable_auto_import=""
-case "$host_os" in
- mingw* | cegcc*)
- lt_enable_auto_import="-Wl,--enable-auto-import"
- ;;
-esac
-AC_SUBST(lt_enable_auto_import)
-
### Checks for compiler characteristics
-AC_C_CONST
AC_C_BIGENDIAN
AC_C_INLINE
AC_C___ATTRIBUTE__
-AC_PROG_CC_STDC
AM_PROG_CC_C_O
EFL_EIO_BUILD=""
esac
AC_SUBST(EFL_EIO_BUILD)
+### Checks for linker characteristics
+
+# use --enable-auto-import on Windows
+
+lt_enable_auto_import=""
+case "$host_os" in
+ mingw* | cegcc*)
+ lt_enable_auto_import="-Wl,--enable-auto-import"
+ ;;
+esac
+AC_SUBST(lt_enable_auto_import)
+
### Checks for library functions
AC_CHECK_FUNCS([fchmod chown getpwnam getgrnam])
### Check for splice system call
-have_splice="no"
+AC_MSG_CHECKING([whether to use splice for file copy])
AC_TRY_LINK(
[
#if defined(HAVE_UNISTD_H)
#endif
#include <fcntl.h>
],
- [long ret = splice(0,0,1,0,400,0);],
+ [
+long ret = splice(0,0,1,0,400,0);
+ ],
[have_splice="yes"],
[have_splice="no"])
-AC_MSG_CHECKING([whether to use splice for file copy])
AC_MSG_RESULT([${have_splice}])
if test "x${have_splice}" = "xyes" ; then
- AC_DEFINE([EFL_HAVE_SPLICE], [1], [Define to mention that splice syscall is supported])
+ AC_DEFINE([HAVE_SPLICE], [1], [Define to mention that splice syscall is supported])
fi
-### Check for lstat
+# Check for lstat
-have_lstat="no"
+AC_MSG_CHECKING([whether lstat is available])
AC_TRY_LINK(
[
#include <sys/types.h>
#endif
],
[
- struct stat st;
- lstat("/tmp", &st);
+struct stat st;
+lstat("/tmp", &st);
],
[have_lstat="yes"],
[have_lstat="no"])
-AC_MSG_CHECKING([whether lstat is available])
AC_MSG_RESULT([${have_lstat}])
if test "x${have_lstat}" = "xyes" ; then
- AC_DEFINE([EFL_HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
+ AC_DEFINE([HAVE_LSTAT], [1], [Define to mention that lstat syscall is supported])
fi
-
-
-### Check for inotify specificity
+# Check for inotify specificity
have_inotify="no"
have_notify_win32="no"
EIO_CHECK_INOTIFY([${want_inotify}], [have_inotify="yes"], [have_inotify="no"])
AM_CONDITIONAL([EIO_HAVE_INOTIFY], [test "x$have_inotify" = "xyes"])
AM_CONDITIONAL([EIO_HAVE_WINCHANGE], [test "x$have_notify_win32" = "xyes"])
-## Report
AC_OUTPUT([
eio.pc
return EINA_FALSE;
}
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
static int
_eio_file_copy_splice(Ecore_Thread *thread, Eio_File_Progress *op, int in, int out, long long size)
{
eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
{
Eina_File *f;
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
struct stat buf;
int in = -1;
#endif
int result = -1;
int out = -1;
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
in = open(copy->source, O_RDONLY);
if (in < 0)
{
if (out < 0)
goto on_error;
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
/* fast file copy code using Linux splice API */
result = _eio_file_copy_splice(thread, copy, in, out, buf.st_size);
if (result == 0)
/* classic copy method using mmap and write */
if (result == -1)
{
-#ifndef EFL_HAVE_SPLICE
+#ifndef HAVE_SPLICE
struct stat buf;
if (stat(copy->source, &buf) < 0)
#endif
close(out);
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
close(in);
#endif
on_error:
eio_file_thread_error(©->common, thread);
-#ifdef EFL_HAVE_SPLICE
+#ifdef HAVE_SPLICE
if (in >= 0) close(in);
#endif
if (out >= 0) close(out);