From 64b608f7e743fb6c6a4de4a85408ea047d6de10c Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Tue, 12 Oct 2004 16:15:54 +0000 Subject: [PATCH] works on mingw now SVN revision: 11842 --- legacy/eet/configure.in | 22 ++++++++++++++++++++++ legacy/eet/src/lib/Makefile.am | 2 +- legacy/embryo/configure.in | 16 ++++++++++++++++ legacy/embryo/src/lib/Makefile.am | 2 +- legacy/embryo/src/lib/embryo_time.c | 26 ++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) diff --git a/legacy/eet/configure.in b/legacy/eet/configure.in index a3eeb13c2d..33de0131a2 100644 --- a/legacy/eet/configure.in +++ b/legacy/eet/configure.in @@ -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]) diff --git a/legacy/eet/src/lib/Makefile.am b/legacy/eet/src/lib/Makefile.am index 57a182d780..413d0480df 100644 --- a/legacy/eet/src/lib/Makefile.am +++ b/legacy/eet/src/lib/Makefile.am @@ -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 diff --git a/legacy/embryo/configure.in b/legacy/embryo/configure.in index 59517b6123..ad1caf6c8a 100644 --- a/legacy/embryo/configure.in +++ b/legacy/embryo/configure.in @@ -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"; diff --git a/legacy/embryo/src/lib/Makefile.am b/legacy/embryo/src/lib/Makefile.am index e131e82abe..eb7fe36692 100644 --- a/legacy/embryo/src/lib/Makefile.am +++ b/legacy/embryo/src/lib/Makefile.am @@ -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 diff --git a/legacy/embryo/src/lib/embryo_time.c b/legacy/embryo/src/lib/embryo_time.c index 6601bffafe..22bfca41bf 100644 --- a/legacy/embryo/src/lib/embryo_time.c +++ b/legacy/embryo/src/lib/embryo_time.c @@ -1,7 +1,33 @@ +/* + * vim:ts=8:sw=3:sts=3:noexpandtab + */ #include "embryo_private.h" #include #include +#ifndef HAVE_GETTIMEOFDAY +#ifdef WIN32 +#include + +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