[PATCH 0/3] scripts: imx: make imx-usb-loader compilable for MinGW

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Apr 11 02:38:41 PDT 2023


While the system flashing Linux is often running Linux itself, it may
be Windows instead. To support this, let's support building
imx-usb-loader for Windows.

Only compiled-tested on Debian 11 with:

   x86_64-w64-mingw32-gcc (GCC) 10-win32 20210110 (gcc-mingw-w64-x86-64-posix)
   libusb-1.0.26-binaries.7z  (from Github releases page)

  CC=${CC:-x86_64-w64-mingw32-gcc}
  LIBUSB=${LIBUSB:-../libusb-binaries}
  
  CPPFLAGS="-isystem $LIBUSB -I scripts/include/ -I include/mach/"
  LDFLAGS="-L $LIBUSB -lusb-1.0"
  
  $CC -c -o imx.o scripts/imx/imx.c $CPPFLAGS
  $CC -c -o imx-usb-loader.o scripts/imx/imx-usb-loader.c $CPPFLAGS
  
  $CC -o imx-usb-loader.exe imx.o imx-usb-loader.o $LDFLAGS


Ahmad Fatoum (3):
  imx-usb-loader: don't depend on arpa/inet.h for endianness conversion
  scripts: compiler.h: add Windows support
  scripts: common: drop unused mman.h include

 scripts/common.c             |  1 -
 scripts/compiler.h           | 33 ++++++++++++++++++++++++
 scripts/imx/imx-usb-loader.c | 49 ++++++++++++++++++------------------
 3 files changed, 57 insertions(+), 26 deletions(-)

-- 
2.39.2




More information about the barebox mailing list