works on mingw now

SVN revision: 11842
This commit is contained in:
tsauerbeck 2004-10-12 16:15:54 +00:00 committed by tsauerbeck
parent 226bc8ccf3
commit 64b608f7e7
5 changed files with 66 additions and 2 deletions

View File

@ -23,6 +23,28 @@ AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your
AC_CHECK_HEADERS(netinet/in.h)
case "$host_os" in
mingw|mingw32)
winsock_libs="-lwsock32"
;;
esac
AC_SUBST(winsock_libs)
AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_CHECK_LIB(fnmatch, fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch])
else
fnmatch_libs="-lfnmatch"
fi
fi
AC_SUBST(fnmatch_libs)
dnl These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])

View File

@ -19,6 +19,6 @@ eet_data.c \
eet_memfile.c \
Eet_private.h
libeet_la_LIBADD = $(LDFLAGS) -lz -ljpeg
libeet_la_LIBADD = $(LDFLAGS) -lz -ljpeg @fnmatch_libs@ @winsock_libs@
libeet_la_DEPENDENCIES = $(top_builddir)/config.h
libeet_la_LDFLAGS = -version-info 9:9:9

View File

@ -20,6 +20,22 @@ AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_CHECK_LIB(fnmatch, fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch])
else
fnmatch_libs="-lfnmatch"
fi
fi
AC_SUBST(fnmatch_libs)
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";

View File

@ -25,6 +25,6 @@ embryo_str.c \
embryo_time.c \
embryo_private.h
libembryo_la_LIBADD = $(LDFLAGS) -lm
libembryo_la_LIBADD = $(LDFLAGS) -lm @fnmatch_libs@
libembryo_la_DEPENDENCIES = $(top_builddir)/config.h
libembryo_la_LDFLAGS = -version-info 9:0:9

View File

@ -1,7 +1,33 @@
/*
* vim:ts=8:sw=3:sts=3:noexpandtab
*/
#include "embryo_private.h"
#include <sys/time.h>
#include <time.h>
#ifndef HAVE_GETTIMEOFDAY
#ifdef WIN32
#include <sys/timeb.h>
static int gettimeofday (struct timeval *tv, void *unused)
{
struct _timeb t;
if (!tv)
return -1;
_ftime (&t);
tv->tv_sec = t.time;
tv->tv_usec = t.millitm * 1000;
return 0;
}
#else
#error "Your platform isn't supported yet"
#endif
#endif
/* exported time api */
static Embryo_Cell