diff --git a/ChangeLog b/ChangeLog index dd24fbf1b0..9393a0062e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-03-07 Christian Stimming + * lib/libqof/qof/guid.c: Make seed collection parts that depend on + particular functions #ifdef'd on that to enable easier + windows/mingw32 porting. + + * lib/libc/setenv.h: Fix old libc substitution files, now needed + for windows/mingw32 porting. + * Makefile.am: Add po/gnucash.pot to EXTRA_DIST because the translation template is needed in the tarball for translators. diff --git a/configure.in b/configure.in index b9ed134b4f..6b8da12f25 100644 --- a/configure.in +++ b/configure.in @@ -114,6 +114,9 @@ if test "x$ac_cv_header_ltdl_h" = xno; then AC_MSG_ERROR([Cannot find ltdl.h -- libtool-devel (or libtool-ltdl-devel) not installed?]) fi +# These are unavailable on windows/mingw32 +AC_CHECK_FUNCS(getppid getuid gethostname gmtime_r) + ### -------------------------------------------------------------------------- ### See if we have pkg-config diff --git a/lib/libqof/qof/guid.c b/lib/libqof/qof/guid.c index 16affda888..b125a18ce9 100644 --- a/lib/libqof/qof/guid.c +++ b/lib/libqof/qof/guid.c @@ -27,7 +27,9 @@ # include #endif -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif #include #include #include @@ -35,7 +37,9 @@ #include #include #include -#include +#ifdef HAVE_TIMES +# include +#endif #include #include #include "qof.h" @@ -285,7 +289,9 @@ init_from_time(void) size_t total; time_t t_time; clock_t clocks; +#ifdef HAVE_TIMES struct tms tms_buf; +#endif total = 0; @@ -293,10 +299,12 @@ init_from_time(void) md5_process_bytes(&t_time, sizeof(t_time), &guid_context); total += sizeof(t_time); +#ifdef HAVE_TIMES clocks = times(&tms_buf); md5_process_bytes(&clocks, sizeof(clocks), &guid_context); md5_process_bytes(&tms_buf, sizeof(tms_buf), &guid_context); total += sizeof(clocks) + sizeof(tms_buf); +#endif return total; } @@ -380,13 +388,16 @@ guid_init(void) md5_process_bytes(&pid, sizeof(pid), &guid_context); bytes += sizeof(pid); +#ifdef HAVE_GETPPID pid = getppid(); md5_process_bytes(&pid, sizeof(pid), &guid_context); bytes += sizeof(pid); +#endif } /* user info */ { +#ifdef HAVE_GETUID uid_t uid; gid_t gid; char *s; @@ -405,16 +416,19 @@ guid_init(void) gid = getgid(); md5_process_bytes(&gid, sizeof(gid), &guid_context); bytes += sizeof(gid); +#endif } /* host info */ { +#ifdef HAVE_GETHOSTNAME char string[1024]; memset(string, 0, sizeof(string)); gethostname(string, sizeof(string)); md5_process_bytes(string, sizeof(string), &guid_context); bytes += sizeof(string); +#endif } /* plain old random */