-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add native Windows / MinGW compilability #96
Comments
Well, AVaRICE has been written with the POSIX API straight from the beginning. That's not a big surprise, given that Atmel has always been supporting Windows natively through their various Studio versions, so the main pupose was to allow using the JTAGICE (and later, its successors) in unixoid environments. I'm afraid, porting it natively to the Windows API basically requires a large rewrite. Given the rather small niche it covers (ARMs and other larger MCUs are well covered by OpenOCD), I wouldn't see anyone willing to spend much effort. It should always be possible to use it under Cygwin, as that emulates the POSIX API. |
I was hoping it would really only be the serial port and sys/socket.h that need a very slight rewrite, and looking at avrdude there already is an abstraction layer written by you with Can we leave this issue open until some experimentation / PR has been done that checks these things out?
But not with an open-source debugging toolchain like GDB, they have their proprietary Atmel Studio. I'm specifically thinking about this. |
Sure, we can leave it open. I suspect pthreads to also be a big roadblock on the path to WinAPI. |
MinGW handles pthreads without problems, testing the source code from here
|
Ok. There's also a |
@maxgerhardt and @dl8dtl BTW, I think the following step for the Windows is a hack and not so correct. I am not so sure how good it will work. https://github.com/avrdudes/avarice/blob/main/.github/workflows/build.yml#L50
By right the binary should depend on the built libusb-1.0.dll for MSYS (/usr/bin/msys-usb-1.0.dll) and not the build for MinGW64. But apparently there is a issue with libusb-compat-0.1 build under MSYS.
The following is another hack which may works better.
|
Using a MSys2/MinGW64 environment with these packages installed
and these build steps, compilation fails at these two types of errors:
It would be nice to not have to go through MSYS2/MSYS emulation, which does allow this program to build (see #95), but it's not as "native" as it could be.
There are forks who have adapted this to compile with MCSV (https://github.com/walx666/avarice/tree/main/src/msvc), but the termios.h implementation is all stubbed. And looking at this it appears to me it would be better to not try and search for an exact substitute for termios.h / sys/socket.h but compile-time switch in the real Windows implementation. I'm sure avrdudes/avrdude already does something like this.
The text was updated successfully, but these errors were encountered: