diff --git a/legacy/eio/Makefile.am b/legacy/eio/Makefile.am index 4909332f34..2fad093c5e 100644 --- a/legacy/eio/Makefile.am +++ b/legacy/eio/Makefile.am @@ -6,6 +6,7 @@ MAINTAINERCLEANFILES = \ ABOUT-NLS \ Makefile.in \ aclocal.m4 \ +compile \ config.cache-env \ config.guess \ config.h.in \ @@ -25,33 +26,20 @@ m4/libtool.m4 \ m4/lt~obsolete.m4 \ m4/ltoptions.m4 \ m4/ltsugar.m4 \ -m4/ltversion.m4 \ -m4/codeset.m4 \ -m4/gettext.m4 \ -m4/glibc21.m4 \ -m4/iconv.m4 \ -m4/intdiv0.m4 \ -m4/inttypes_h.m4 \ -m4/inttypes.m4 \ -m4/inttypes-pri.m4 \ -m4/isc-posix.m4 \ -m4/lcmessage.m4 \ -m4/lib-ld.m4 \ -m4/lib-link.m4 \ -m4/lib-prefix.m4 \ -m4/nls.m4 \ -m4/po.m4 \ -m4/progtest.m4 \ -m4/stdint_h.m4 \ -m4/uintmax_t.m4 \ -m4/ulonglong.m4 +m4/ltversion.m4 EXTRA_DIST = \ AUTHORS \ COPYING \ +README \ autogen.sh \ eio.spec \ -eio.pc.in +eio.pc.in \ +m4/ac_attribute.m4 \ +m4/efl_doxygen.m4 \ +m4/efl_path_max.m4 \ +m4/efl_threads.m4 \ +m4/eio_check_options.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = eio.pc diff --git a/legacy/eio/README b/legacy/eio/README index 9ebc9b2aba..15bb070727 100644 --- a/legacy/eio/README +++ b/legacy/eio/README @@ -6,7 +6,7 @@ EIO 1.0.0 enlightenment-devel@lists.sourceforge.net ****************************************************************************** - + Enlightenment Input Output Library ================================== @@ -24,4 +24,4 @@ COMPILING AND INSTALLING: make (do this as root unless you are installing in your users directories): make install - + diff --git a/legacy/eio/configure.ac b/legacy/eio/configure.ac index 67008ee526..dbda1484e8 100644 --- a/legacy/eio/configure.ac +++ b/legacy/eio/configure.ac @@ -23,12 +23,17 @@ AC_INIT([eio], [v_ver]-alpha, [enlightenment-devel@lists.sourceforge.net]) 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 @@ -49,19 +54,27 @@ AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version]) 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" ;; *) @@ -69,10 +82,11 @@ case "$host_os" in ;; 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 @@ -82,24 +96,27 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then 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 @@ -124,6 +141,20 @@ EFL_CHECK_PATH_MAX ### Checks for structures +### Checks for compiler characteristics +AC_C_BIGENDIAN +AC_C_INLINE +AC_C___ATTRIBUTE__ +AM_PROG_CC_C_O + +EFL_EIO_BUILD="" +case "$host_os" in + mingw*) + EFL_EIO_BUILD="-DEFL_EIO_BUILD" + ;; +esac +AC_SUBST(EFL_EIO_BUILD) + ### Checks for linker characteristics # use --enable-auto-import on Windows @@ -136,28 +167,12 @@ case "$host_os" in 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="" -case "$host_os" in - mingw*) - EFL_EIO_BUILD="-DEFL_EIO_BUILD" - ;; -esac -AC_SUBST(EFL_EIO_BUILD) - ### 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) @@ -165,19 +180,20 @@ AC_TRY_LINK( #endif #include ], - [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 @@ -187,21 +203,18 @@ AC_TRY_LINK( #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"]) @@ -210,7 +223,6 @@ EIO_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_ 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 diff --git a/legacy/eio/src/lib/eio_file.c b/legacy/eio/src/lib/eio_file.c index 5c9bba8e7e..d0067e37ae 100644 --- a/legacy/eio/src/lib/eio_file.c +++ b/legacy/eio/src/lib/eio_file.c @@ -369,7 +369,7 @@ _eio_file_copy_mmap(Ecore_Thread *thread, Eio_File_Progress *op, Eina_File *f, i 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) { @@ -602,7 +602,7 @@ Eina_Bool 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 @@ -610,7 +610,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) int result = -1; int out = -1; -#ifdef EFL_HAVE_SPLICE +#ifdef HAVE_SPLICE in = open(copy->source, O_RDONLY); if (in < 0) { @@ -633,7 +633,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) 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) @@ -643,7 +643,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) /* 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) @@ -684,7 +684,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) #endif close(out); -#ifdef EFL_HAVE_SPLICE +#ifdef HAVE_SPLICE close(in); #endif @@ -693,7 +693,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) 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); diff --git a/legacy/eio/src/lib/eio_private.h b/legacy/eio/src/lib/eio_private.h index 434f207904..bb213f29eb 100644 --- a/legacy/eio/src/lib/eio_private.h +++ b/legacy/eio/src/lib/eio_private.h @@ -5,26 +5,48 @@ # include "config.h" #endif -#ifdef HAVE_FEATURES_H -# include +#include +#ifdef HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen ((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) ((dirent)->d_namlen) +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif #endif #include #include - -#ifndef _MSC_VER -# include -# include -#endif - #include #include #include #include -#include #include #include -#include + +#ifdef HAVE_PWD_H +# include +#endif + +#ifdef HAVE_FEATURES_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_LIBGEN_H +# include +#endif #ifdef HAVE_GRP_H # include @@ -35,7 +57,11 @@ #endif #ifdef EFL_HAVE_WIN32_THREADS +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include +# undef WIN32_LEAN_AND_MEAN #endif #include diff --git a/legacy/eio/src/lib/eio_single.c b/legacy/eio/src/lib/eio_single.c index bca2399552..3c8ac898d1 100644 --- a/legacy/eio/src/lib/eio_single.c +++ b/legacy/eio/src/lib/eio_single.c @@ -146,7 +146,7 @@ _eio_file_stat(void *data, Ecore_Thread *thread) _eio_file_struct_2_eina(&s->buffer, &buf); } -#ifdef EFL_HAVE_LSTAT +#ifdef HAVE_LSTAT static void _eio_file_lstat(void *data, Ecore_Thread *thread) { @@ -419,7 +419,7 @@ eio_file_direct_lstat(const char *path, Eio_Error_Cb error_cb, const void *data) { -#ifdef EFL_HAVE_LSTAT +#ifdef HAVE_LSTAT Eio_File_Stat *s = NULL; if (!path || !done_cb || !error_cb)