diff --git a/acx_pthread.m4 b/acx_pthread.m4 index bedf51c..8b7271f 100644 --- a/acx_pthread.m4 +++ b/acx_pthread.m4 @@ -74,6 +74,9 @@ case "${host_cpu}-${host_os}" in acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; + *mingw*) + acx_pthread_flags="none" + ;; esac if test x"$acx_pthread_ok" = xno; then diff --git a/configure.ac b/configure.ac index 3d03ce3..9b44b45 100644 --- a/configure.ac +++ b/configure.ac @@ -896,6 +896,7 @@ AC_CHECK_TOOL([OBJCOPY], [objcopy]) AC_CHECK_TOOL([OBJDUMP], [objdump]) AC_CHECK_TOOL([RANLIB], [ranlib]) AC_CHECK_TOOL([READELF], [readelf]) +AC_CHECK_TOOL([WINDRES], [windres]) LT_INIT([dlopen win32-dll]) dnl Check for system header files @@ -1083,6 +1084,7 @@ fi AC_LANG_POP(C++) dnl Check for functions +if test $PLATFORM != win32; then AC_CHECK_FUNCS(gettimeofday) if test "$ac_cv_func_gettimeofday" = "yes"; then AC_MSG_CHECKING(if gettimeofday accepts second (timezone) argument) @@ -1095,6 +1097,7 @@ if test "$ac_cv_func_gettimeofday" = "yes"; then #define GETTIMEOFDAY(x) gettimeofday((x)) #endif]) fi +fi AC_CHECK_FUNCS(time times) AC_CHECK_FUNCS(nanosleep) AC_SEARCH_LIBS(gethostname,nsl) @@ -1165,6 +1168,7 @@ dnl Check for time function AC_SEARCH_LIBS(clock_gettime, rt) AC_CHECK_FUNCS(clock_gettime) +if test $PLATFORM != win32; then dnl Checks for pthread functions AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) @@ -1203,6 +1207,7 @@ if test "$ac_cv_header_iconv_h" = "yes"; then AC_SEARCH_LIBS(iconv_open, iconv) AC_SEARCH_LIBS(libiconv_open, iconv) fi +fi dnl HPUX has a bug in .h files. To detect it we need C++ here. AC_LANG_PUSH(C++) @@ -1363,7 +1368,7 @@ case "$PLATFORM" in ;; win32) - XE_PREPEND( -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS) + XE_PREPEND( -lmpr -lversion -lws2_32 -lole32,LIBS) ;; *) diff --git a/src/misc/writeBuildNum.sh b/src/misc/writeBuildNum.sh index 4dd72c7..114c0eb 100755 --- a/src/misc/writeBuildNum.sh +++ b/src/misc/writeBuildNum.sh @@ -105,12 +105,16 @@ grep ODS_VERSION $OdsH | grep -v ENCODE_ODS >$Mini cat >$TestCpp < typedef unsigned short USHORT; +#ifdef __MINGW32__ +#include "miniods.h" +#else #include "$Mini" +#endif int main() { return ODS_VERSION; } eof -[ -z "$CXX" ] && CXX=g++ +[ -z "$CXX" ] && CXX=g++ && CXX=c++ $CXX $TestCpp -o $AOut if [ -x $AOut ]