On Mon, Dec 5, 2011 at 2:57 PM, Enlightenment SVN < no-re...@enlightenment.org> wrote:
> Log: > eina: improve system header detection. > > > Author: cedric > Date: 2011-12-05 05:57:10 -0800 (Mon, 05 Dec 2011) > New Revision: 65900 > Trac: http://trac.enlightenment.org/e/changeset/65900 > > Modified: > trunk/eina/configure.ac trunk/eina/src/lib/Makefile.am > trunk/eina/src/lib/eina_file.c trunk/eina/src/lib/eina_simple_xml_parser.c > > Modified: trunk/eina/configure.ac > =================================================================== > --- trunk/eina/configure.ac 2011-12-05 10:49:46 UTC (rev 65899) > +++ trunk/eina/configure.ac 2011-12-05 13:57:10 UTC (rev 65900) > @@ -355,10 +355,9 @@ > > ### Checks for header files > AC_HEADER_ASSERT > -AC_HEADER_DIRENT > keep it and look at autoconf manual. > AC_HEADER_TIME > EFL_CHECK_PATH_MAX > -AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h > siginfo.h]) > +AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h > siginfo.h strings.h sys/mman.h]) > > if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then > EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H" > @@ -372,6 +371,14 @@ > fi > AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H]) > > +if test "x${ac_cv_header_strings_h}" = "xyes" ; then > + AC_DEFINE([HAVE_STRINGS_H], [1], [Define to 1 if you have the > <strings.h> header file.]) > +fi > useless : it's already defined > + > +if test "x${ac_cv_header_sys_mman_h}" = "xyes" ; then > + AC_DEFINE([HAVE_MMAN_H], [1], [Define to 1 if you have the > <sys/mman.h> header file.]) > +fi > useless HAVE_SYS_MMAN_H is already defined > + > ### Checks for types > > AC_CHECK_SIZEOF([wchar_t]) > @@ -384,9 +391,18 @@ > #endif > ]]) > > -### Checks for structures > +### Check if dirent.h is usable > > +AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"], > + [[#include <dirent.h> > + ]]) > don't do that, see above. Vincent > +if test "x${have_dirent_h}" = "xyes" ; then > + EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H" > + AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid > <dirent.h> header file.]) > +fi > +AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H]) > + > ### Checks for compiler characteristics > AC_C_CONST > AC_C_BIGENDIAN > > Modified: trunk/eina/src/lib/Makefile.am > =================================================================== > --- trunk/eina/src/lib/Makefile.am 2011-12-05 10:49:46 UTC (rev 65899) > +++ trunk/eina/src/lib/Makefile.am 2011-12-05 13:57:10 UTC (rev 65900) > @@ -130,12 +130,17 @@ > @echo "#include <stdio.h>" >> eina_amalgamation.c > @echo "#include <stdlib.h>" >> eina_amalgamation.c > @echo "#include <string.h>" >> eina_amalgamation.c > - @echo "#include <dlfcn.h>" >> eina_amalgamation.c > + @echo "#ifdef HAVE_DLOPEN" >> eina_amalgamation.c > + @echo "# include <dlfcn.h>" >> eina_amalgamation.c > + @echo "#endif" >> eina_amalgamation.c > @echo "#include <sys/types.h>" >> eina_amalgamation.c > - @echo "#include <dirent.h>" >> eina_amalgamation.c > + @echo "#ifdef HAVE_DIRENT_H" >> eina_amalgamation.c > + @echo "# include <dirent.h>" >> eina_amalgamation.c > + @echo "#endif" >> eina_amalgamation.c > @echo "#include <assert.h>" >> eina_amalgamation.c > @echo "#include <errno.h>" >> eina_amalgamation.c > @echo "#include <fnmatch.h>" >> eina_amalgamation.c > + @echo "#include <fcntl.h>" >> eina_amalgamation.c > > @echo "#ifdef HAVE_EVIL" >> eina_amalgamation.c > @echo "# include <Evil.h>" >> eina_amalgamation.c > > Modified: trunk/eina/src/lib/eina_file.c > =================================================================== > --- trunk/eina/src/lib/eina_file.c 2011-12-05 10:49:46 UTC (rev 65899) > +++ trunk/eina/src/lib/eina_file.c 2011-12-05 13:57:10 UTC (rev 65900) > @@ -40,11 +40,15 @@ > > #include <string.h> > #include <stddef.h> > -#include <dirent.h> > +#ifdef HAVE_DIRENT_H > +# include <dirent.h> > +#endif > #include <sys/types.h> > #include <sys/stat.h> > #include <unistd.h> > -#include <sys/mman.h> > +#ifdef HAVE_MMAN_H > +# include <sys/mman.h> > +#endif > #include <fcntl.h> > > #define PATH_DELIM '/' > @@ -60,6 +64,7 @@ > #include "eina_list.h" > #include "eina_lock.h" > #include "eina_mmap.h" > +#include "eina_log.h" > > #ifdef HAVE_ESCAPE_H > # include <Escape.h> > @@ -95,9 +100,8 @@ > #define EINA_SMALL_PAGE 4096 > # define EINA_HUGE_PAGE 16 * 1024 * 1024 > > +#ifdef HAVE_DIRENT_H > typedef struct _Eina_File_Iterator Eina_File_Iterator; > -typedef struct _Eina_File_Map Eina_File_Map; > - > struct _Eina_File_Iterator > { > Eina_Iterator iterator; > @@ -107,6 +111,7 @@ > > char dir[1]; > }; > +#endif > > struct _Eina_File > { > @@ -134,6 +139,7 @@ > Eina_Bool delete_me : 1; > }; > > +typedef struct _Eina_File_Map Eina_File_Map; > struct _Eina_File_Map > { > void *map; > @@ -156,6 +162,7 @@ > * The code and description of the issue can be found at : > * http://womble.decadent.org.uk/readdir_r-advisory.html > */ > +#ifdef HAVE_DIRENT_H > static long > _eina_name_max(DIR *dirp) > { > @@ -390,6 +397,7 @@ > > return EINA_TRUE; > } > +#endif > > static void > _eina_file_real_close(Eina_File *file) > @@ -738,6 +746,7 @@ > EAPI Eina_Iterator * > eina_file_ls(const char *dir) > { > +#ifdef HAVE_DIRENT_H > Eina_File_Iterator *it; > size_t length; > > @@ -773,11 +782,16 @@ > it->iterator.free = FUNC_ITERATOR_FREE(_eina_file_ls_iterator_free); > > return &it->iterator; > +#else > + (void) dir; > + return NULL; > +#endif > } > > EAPI Eina_Iterator * > eina_file_direct_ls(const char *dir) > { > +#ifdef HAVE_DIRENT_H > Eina_File_Direct_Iterator *it; > size_t length; > > @@ -825,11 +839,16 @@ > it->iterator.free = > FUNC_ITERATOR_FREE(_eina_file_direct_ls_iterator_free); > > return &it->iterator; > +#else > + (void) dir; > + return NULL; > +#endif > } > > EAPI Eina_Iterator * > eina_file_stat_ls(const char *dir) > { > +#ifdef HAVE_DIRENT_H > Eina_File_Direct_Iterator *it; > size_t length; > > @@ -877,6 +896,10 @@ > it->iterator.free = > FUNC_ITERATOR_FREE(_eina_file_direct_ls_iterator_free); > > return &it->iterator; > +#else > + (void) dir; > + return NULL; > +#endif > } > > EAPI Eina_File * > @@ -887,7 +910,9 @@ > char *filename; > struct stat file_stat; > int fd = -1; > +#ifdef HAVE_EXECVP > int flags; > +#endif > > EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); > > > Modified: trunk/eina/src/lib/eina_simple_xml_parser.c > =================================================================== > --- trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-05 10:49:46 UTC > (rev 65899) > +++ trunk/eina/src/lib/eina_simple_xml_parser.c 2011-12-05 13:57:10 UTC > (rev 65900) > @@ -38,7 +38,9 @@ > void *alloca (size_t); > #endif > > -#include <strings.h> > +#ifdef HAVE_STRINGS_H > +# include <strings.h> > +#endif > #include <string.h> > #include <ctype.h> > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel