Windows building advice

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows building advice

Enoch W.
Hi,

Are there any instructions how to build the latest AVRDUDE code for
Windows under Linux?

My favorite method, MXE <http://mxe.cc/>, fails :-(

Thanks, Enoch.


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Enoch wrote:

> Are there any instructions how to build the latest AVRDUDE code for
> Windows under Linux?

Did you try the tools/build-mingw32.sh script?

Basic instructions are recorded in a comment on top.  In particular,
if you want to build with libusb support, you have to tell it (via env
variables) where the Win32 libusb is to be found.

I just tried the script on my FreeBSD, and it still compiles.  Will
try a Linux version later today.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Joerg Wunsch wrote:

> I just tried the script on my FreeBSD, and it still compiles.  Will
> try a Linux version later today.

It stops here:

i686-w64-mingw32-gcc -Wall -Wno-pointer-sign -g -O2 -DWIN32NATIVE  -L/usr/i686-w64-mingw32/lib -static -o avrdude.exe avrdude-main.o avrdude-term.o ./libavrdude.a        -lm
./libavrdude.a: could not read symbols: Archive has no index; run ranlib to add one

Even though before, ranlib did run on the archive:

ar cru libavrdude.a libavrdude_a-config_gram.o libavrdude_a-lexer.o libavrdude_a-arduino.o libavrdude_a-avr.o libavrdude_a-avr910.o libavrdude_a-avrftdi.o libavrdude_a-avrftdi_tpi.o libavrdude_a-avrpart.o libavrdude_a-bitbang.o libavrdude_a-buspirate.o libavrdude_a-butterfly.o libavrdude_a-config.o libavrdude_a-confwin.o libavrdude_a-crc16.o libavrdude_a-fileio.o libavrdude_a-ft245r.o libavrdude_a-jtagmkI.o libavrdude_a-jtagmkII.o libavrdude_a-jtag3.o libavrdude_a-linuxgpio.o libavrdude_a-lists.o libavrdude_a-par.o libavrdude_a-pgm.o libavrdude_a-pgm_type.o libavrdude_a-pickit2.o libavrdude_a-pindefs.o libavrdude_a-ppi.o libavrdude_a-ppiwin.o libavrdude_a-safemode.o libavrdude_a-serbb_posix.o libavrdude_a-serbb_win32.o libavrdude_a-ser_avrdoper.o libavrdude_a-ser_posix.o libavrdude_a-ser_win32.o libavrdude_a-stk500.o libavrdude_a-stk500v2.o libavrdude_a-stk500generic.o libavrdude_a-usbasp.o libavrdude_a-usb_libusb.o libavrdude_a-usbtiny.o libavrdude_a-update.o libavrdude_a-wiring.o
ranlib libavrdude.a

For whatever reason, one has to explicitly run

i686-w64-mingw32-ranlib libavrdude.a

If someone has ideas, how to fix this in configure.ac, they are
certainly welcome.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

René Liebscher
   Hi,

   when using "i686-w64-mingw32-gcc" then we probably should use
   i686-w64-mingw32-ar and i686-w64-mingw32-ranlib instead of ar and
   ranlib?

   Fixing this might also solve this problem
   http://savannah.nongnu.org/bugs/?37489


   René

   Gesendet: Montag, 09. September 2013 um 10:49 Uhr
   Von: "Joerg Wunsch" <[hidden email]>
   An: [hidden email]
   Betreff: Re: [avrdude-dev] Windows building advice
   As Joerg Wunsch wrote:
   > I just tried the script on my FreeBSD, and it still compiles. Will
   > try a Linux version later today.
   It stops here:
   i686-w64-mingw32-gcc -Wall -Wno-pointer-sign -g -O2 -DWIN32NATIVE
   -L/usr/i686-w64-mingw32/lib -static -o avrdude.exe avrdude-main.o
   avrdude-term.o ./libavrdude.a -lm
   ./libavrdude.a: could not read symbols: Archive has no index; run
   ranlib to add one
   Even though before, ranlib did run on the archive:
   ar cru libavrdude.a libavrdude_a-config_gram.o libavrdude_a-lexer.o
   libavrdude_a-arduino.o libavrdude_a-avr.o libavrdude_a-avr910.o
   libavrdude_a-avrftdi.o libavrdude_a-avrftdi_tpi.o
   libavrdude_a-avrpart.o libavrdude_a-bitbang.o libavrdude_a-buspirate.o
   libavrdude_a-butterfly.o libavrdude_a-config.o libavrdude_a-confwin.o
   libavrdude_a-crc16.o libavrdude_a-fileio.o libavrdude_a-ft245r.o
   libavrdude_a-jtagmkI.o libavrdude_a-jtagmkII.o libavrdude_a-jtag3.o
   libavrdude_a-linuxgpio.o libavrdude_a-lists.o libavrdude_a-par.o
   libavrdude_a-pgm.o libavrdude_a-pgm_type.o libavrdude_a-pickit2.o
   libavrdude_a-pindefs.o libavrdude_a-ppi.o libavrdude_a-ppiwin.o
   libavrdude_a-safemode.o libavrdude_a-serbb_posix.o
   libavrdude_a-serbb_win32.o libavrdude_a-ser_avrdoper.o
   libavrdude_a-ser_posix.o libavrdude_a-ser_win32.o libavrdude_a-stk500.o
   libavrdude_a-stk500v2.o libavrdude_a-stk500generic.o
   libavrdude_a-usbasp.o libavrdude_a-usb_libusb.o libavrdude_a-usbtiny.o
   libavrdude_a-update.o libavrdude_a-wiring.o
   ranlib libavrdude.a
   For whatever reason, one has to explicitly run
   i686-w64-mingw32-ranlib libavrdude.a
   If someone has ideas, how to fix this in configure.ac, they are
   certainly welcome.
   --
   cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
   [1]http://www.sax.de/~joerg/
   Never trust an operating system you don't have sources for. ;-)
   _______________________________________________
   avrdude-dev mailing list
   [hidden email]
   [2]https://lists.nongnu.org/mailman/listinfo/avrdude-dev

References

   1. http://www.sax.de/~joerg/
   2. https://lists.nongnu.org/mailman/listinfo/avrdude-dev
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Rene Liebscher wrote:

>    when using "i686-w64-mingw32-gcc" then we probably should use
>    i686-w64-mingw32-ar and i686-w64-mingw32-ranlib instead of ar and
>    ranlib?

I'm all for it.

Does someone know the autoconf magic for this?
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
In reply to this post by Joerg Wunsch
As Joerg Wunsch wrote:

> > I just tried the script on my FreeBSD, and it still compiles.  Will
> > try a Linux version later today.
>
> It stops here:
>
> i686-w64-mingw32-gcc -Wall -Wno-pointer-sign -g -O2 -DWIN32NATIVE  -L/usr/i686-w64-mingw32/lib -static -o avrdude.exe avrdude-main.o avrdude-term.o ./libavrdude.a        -lm
> ./libavrdude.a: could not read symbols: Archive has no index; run ranlib to add one

With some nice tips from Rene Liebscher, I got it working to
pick the correct target tools for ar and ranlib.

For me, the build-mingw32.sh script now works on both, FreeBSD
and Linux.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Weddington, Eric
In reply to this post by Joerg Wunsch


> -----Original Message-----
> From: avrdude-dev-bounces+eric.weddington=[hidden email]
> [mailto:avrdude-dev-bounces+eric.weddington=[hidden email]] On
> Behalf Of Joerg Wunsch
> Sent: Monday, September 09, 2013 2:50 AM
> To: [hidden email]
> Subject: Re: [avrdude-dev] Windows building advice
>
>
> Even though before, ranlib did run on the archive:
>
> ar cru libavrdude.a libavrdude_a-config_gram.o libavrdude_a-lexer.o
> libavrdude_a-arduino.o libavrdude_a-avr.o libavrdude_a-avr910.o
> libavrdude_a-avrftdi.o libavrdude_a-avrftdi_tpi.o libavrdude_a-
> avrpart.o libavrdude_a-bitbang.o libavrdude_a-buspirate.o libavrdude_a-
> butterfly.o libavrdude_a-config.o libavrdude_a-confwin.o libavrdude_a-
> crc16.o libavrdude_a-fileio.o libavrdude_a-ft245r.o libavrdude_a-
> jtagmkI.o libavrdude_a-jtagmkII.o libavrdude_a-jtag3.o libavrdude_a-
> linuxgpio.o libavrdude_a-lists.o libavrdude_a-par.o libavrdude_a-pgm.o
> libavrdude_a-pgm_type.o libavrdude_a-pickit2.o libavrdude_a-pindefs.o
> libavrdude_a-ppi.o libavrdude_a-ppiwin.o libavrdude_a-safemode.o
> libavrdude_a-serbb_posix.o libavrdude_a-serbb_win32.o libavrdude_a-
> ser_avrdoper.o libavrdude_a-ser_posix.o libavrdude_a-ser_win32.o
> libavrdude_a-stk500.o libavrdude_a-stk500v2.o libavrdude_a-
> stk500generic.o libavrdude_a-usbasp.o libavrdude_a-usb_libusb.o
> libavrdude_a-usbtiny.o libavrdude_a-update.o libavrdude_a-wiring.o
> ranlib libavrdude.a
>
> For whatever reason, one has to explicitly run
>
> i686-w64-mingw32-ranlib libavrdude.a

I thought that there were switches to "ar" that can be used to have it automatically run ranlib and/or generate an index without having to run ranlib again...

Eric

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Weddington, Eric wrote:

> I thought that there were switches to "ar" that can be used to have
> it automatically run ranlib and/or generate an index without having
> to run ranlib again...

Probably, but even then, I'm afraid, the correct ar has to be used
(the one for the target rather than the host's one).

Using the autoconf trickery Rene told me, I got it to do just this:
use both, ar and ranlib, for the target system.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Weddington, Eric


> -----Original Message-----
> From: avrdude-dev-bounces+eric.weddington=[hidden email]
> [mailto:avrdude-dev-bounces+eric.weddington=[hidden email]] On
> Behalf Of Joerg Wunsch
> Sent: Monday, September 09, 2013 12:47 PM
> To: [hidden email]
> Subject: Re: [avrdude-dev] Windows building advice
>
> As Weddington, Eric wrote:
>
> > I thought that there were switches to "ar" that can be used to have
> > it automatically run ranlib and/or generate an index without having
> > to run ranlib again...
>
> Probably, but even then, I'm afraid, the correct ar has to be used
> (the one for the target rather than the host's one).

Ah, the usual suspects, then. ;-)

 
> Using the autoconf trickery Rene told me, I got it to do just this:
> use both, ar and ranlib, for the target system.

Great!

Eric

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Enoch W.
In reply to this post by Joerg Wunsch
Joerg Wunsch <[hidden email]> writes:

> As Weddington, Eric wrote:
>
>> I thought that there were switches to "ar" that can be used to have
>> it automatically run ranlib and/or generate an index without having
>> to run ranlib again...
>
> Probably, but even then, I'm afraid, the correct ar has to be used
> (the one for the target rather than the host's one).
>
> Using the autoconf trickery Rene told me, I got it to do just this:
> use both, ar and ranlib, for the target system.

I can confirm that using MXE too <http://mxe.cc/> avrdude builds after
correcting Makefile's wrong "AR = :" with "AR = i686-pc-mingw32-ar".

My next problem is replacing the need for an external libusb0.dll with
MXE's provided (static) libusb.a.
Currently configure is missing a --disable-shared option.

Indeed, an autotools expert is needed :-)

Thanks Enoch.



_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Enoch wrote:

> My next problem is replacing the need for an external libusb0.dll with
> MXE's provided (static) libusb.a.

Normally, it should automatically put a -static there.

What do you see here?

checking if linker accepts -static... yes

--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Enoch W.
Hello Joerg,

I was expecting your Mon Sep 9 15:00:36 2013 +0000 patch which is
described as

"Check for ar and ranlib in the target tool namespace, rather than on
the host."

to fix the problem with Makefile's AR using the MXE cross-environment
but it does not.  We still have a weird "AR = :" generated.

Fixing manually is easy "AR = i686-pc-mingw32-ar" but it better be done
via configure :-)

Thanks, Enoch.


Joerg Wunsch <[hidden email]> writes:

> As Enoch wrote:
>
>> My next problem is replacing the need for an external libusb0.dll with
>> MXE's provided (static) libusb.a.
>
> Normally, it should automatically put a -static there.
>
> What do you see here?
>
> checking if linker accepts -static... yes


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Joerg Wunsch
As Enoch wrote:

> I was expecting your Mon Sep 9 15:00:36 2013 +0000 patch which is
> described as
>
> "Check for ar and ranlib in the target tool namespace, rather than on
> the host."

Well, it's in SVN already.

But here it is again, if that's simpler for you:

Index: configure.ac
===================================================================
--- configure.ac (revision 1213)
+++ configure.ac (revision 1214)
@@ -39,7 +39,14 @@
 AC_PROG_SED
 AC_PROG_YACC
 AC_PROG_LEX
+AN_MAKEVAR([RANLIB], [AC_PROG_RANLIB])
+AN_PROGRAM([ranlib], [AC_PROG_RANLIB])
+AC_DEFUN([AC_PROG_RANLIB], [AC_CHECK_TARGET_TOOL(RANLIB, ranlib, :)])
 AC_PROG_RANLIB
+AN_MAKEVAR([AR], [AC_PROG_AR])
+AN_PROGRAM([ar], [AC_PROG_AR])
+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TARGET_TOOL(AR, ar, :)])
+AC_PROG_AR
 AH_TEMPLATE([HAVE_YYLEX_DESTROY],
             [Define if lex/flex has yylex_destroy])
 # flex should have this

--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: Windows building advice

Xiaofan Chen
In reply to this post by Enoch W.
On Tue, Sep 10, 2013 at 4:29 AM, Enoch <[hidden email]> wrote:
> I can confirm that using MXE too <http://mxe.cc/> avrdude builds after
> correcting Makefile's wrong "AR = :" with "AR = i686-pc-mingw32-ar".
>
> My next problem is replacing the need for an external libusb0.dll with
> MXE's provided (static) libusb.a.
> Currently configure is missing a --disable-shared option.

Just a clarification, I do not believe the libusb.a provided by MXE
is really a static library. I am not using MXE myself (tried it under
Mac OS X and then deleted it) but I am one of the admins of
libusb-win32 project. We never provide a static version of libusb.a
(gcc) or libusb.lib (MSVC). The file libusb.a is actually a dynamic
import library for libusb0.dll, it should probably have called
libusb.dll.a or things like that.

So you will still need an external libusb0.dll which will be installed
to the system when you install the supported driver for libusb-win32
(libusb0.sys or libusbK.sys).

> Indeed, an autotools expert is needed :-)


--
Xiaofan

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev