From: rc_gmail_imap <rem...@gm...> - 2013-08-23 20:06:35
|
fldigi has a similar problem with sleep(), here is how it is solved: static void LocalSleep( int seconds ) { #ifdef __MINGW32__ MilliSleep(seconds); #else usleep(100000*seconds); #endif } void MilliSleep(long msecs) { #ifndef __MINGW32__ struct timespec tv[2] = { {msecs / 1000L, msecs % 1000L * 1000000L} }; nanosleep(&tv[0], &tv[1]); #else Sleep(msecs); #endif } Le 22.08.2013 22:36, Bill Somerville a écrit : > On 20/08/2013 21:49, Nate Bargmann wrote: > Hi Nate, >> Hamlib Version 1.2.15.3 configuration: >> Ahhh, I made a lot of changes to the build system in 3.0 (master branch). >> Try a daily source snapshot and see how that works: > I have cloned master and am trying to build using Mingw 64-bit toolchain > using cygwin. Ths is good for autotools and libtool but I get a compile > error as follows: > > Making all in yaesu > make[1]: Entering directory > `/cygdrive/C/Users/bill/Documents/vbox-shares/src/hamlib-code/yaesu' > CC ft100.lo > CC ft747.lo > CC ft817.lo > CC ft847.lo > CC ft890.lo > CC ft900.lo > CC ft920.lo > CC ft1000mp.lo > CC ft857.lo > CC ft897.lo > CC ft990.lo > CC frg8800.lo > CC ft757gx.lo > In file included from ft757gx.c:63:0: > ../include/hl_sleep.h:33:28: error: static declaration of 'sleep' > follows non-static declaration > In file included from ft757gx.c:44:0: > /usr/x86_64-w64-mingw32/sys-root/mingw/include/unistd.h:34:22: note: > previous declaration of 'sleep' was here > Makefile:556: recipe for target `ft757gx.lo' failed > make[1]: *** [ft757gx.lo] Error 1 > make[1]: Leaving directory > `/cygdrive/C/Users/bill/Documents/vbox-shares/src/hamlib-code/yaesu' > Makefile:561: recipe for target `all-recursive' failed > make: *** [all-recursive] Error 1 > > looks like there needs to be some different config macro checking going on. > > I tried the following and the build progressed ok: > > $ git diff > diff --git a/adat/adat.c b/adat/adat.c > index cab58b3..561c6ba 100644 > --- a/adat/adat.c > +++ b/adat/adat.c > @@ -59,7 +59,7 @@ > * when compiling on Windows using MinGW where HAVE_SLEEP will be > * undefined. > */ > -#if defined(HAVE_SSLEEP)&& (!defined(HAVE_SLEEP) || defined(_WIN32)) > +#if defined(HAVE_SSLEEP)&& !defined(HAVE_SLEEP) > #include "hl_sleep.h" > #endif > > diff --git a/tentec/paragon.c b/tentec/paragon.c > index cf351f1..c41fbe8 100644 > --- a/tentec/paragon.c > +++ b/tentec/paragon.c > @@ -46,7 +46,7 @@ > * when compiling on Windows using MinGW where HAVE_SLEEP will be > * undefined. > */ > -#if defined(HAVE_SSLEEP)&& (!defined(HAVE_SLEEP) || defined(_WIN32)) > +#if defined(HAVE_SSLEEP)&& !defined(HAVE_SLEEP) > #include "hl_sleep.h" > #endif > > diff --git a/tentec/tt550.c b/tentec/tt550.c > index 7140023..638baea 100644 > --- a/tentec/tt550.c > +++ b/tentec/tt550.c > @@ -49,7 +49,7 @@ > * when compiling on Windows using MinGW where HAVE_SLEEP will be > * undefined. > */ > -#if defined(HAVE_SSLEEP)&& (!defined(HAVE_SLEEP) || defined(_WIN32)) > +#if defined(HAVE_SSLEEP)&& !defined(HAVE_SLEEP) > #include "hl_sleep.h" > #endif > > diff --git a/yaesu/ft757gx.c b/yaesu/ft757gx.c > index fde380d..3ed01bc 100644 > --- a/yaesu/ft757gx.c > +++ b/yaesu/ft757gx.c > @@ -59,7 +59,7 @@ > * when compiling on Windows using MinGW where HAVE_SLEEP will be > * undefined. > */ > -#if defined(HAVE_SSLEEP)&& (!defined(HAVE_SLEEP) || defined(_WIN32)) > +#if defined(HAVE_SSLEEP)&& !defined(HAVE_SLEEP) > #include "hl_sleep.h" > #endif > > > I'm sure these changes aren't correct for other Windows tool chains but > it worked for cross compile built on cygwin 32-bit using the Cygwin > x86_64-w64-mingw32 64-bit MinGW tool chain. > > I also had to add LIBS=-lpthread to the configure command so selection > of the pthread library is working either on that platform. I believe > -lpthread has to be specified for C& C++ links with MinGW to use the > libwinpthread thread support library. >> http://n0nb.users.sourceforge.net >> >> I think we will be dropping the need for libltdl in Hamlib 3.0. As it >> has caused quite a bit of pain, this should ease issues like this. >> >> 73, de Nate>> >> > HTH > 73 > Bill > G4WJS. > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Hamlib-developer mailing list > Ham...@li... > https://lists.sourceforge.net/lists/listinfo/hamlib-developer |