Skip to content

Commit 47fd24e

Browse files
committed
Merge branch 'support_avrdude' into main
2 parents a26055f + 4d4a79f commit 47fd24e

File tree

1,714 files changed

+681265
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,714 files changed

+681265
-31
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
1818
libz-dev \
1919
# Install Windows cross-tools
2020
mingw-w64 \
21+
xsltproc \
2122
p7zip-full \
2223
pkg-config \
2324
tar \
25+
unzip \
2426
&& rm -rf /var/lib/apt/lists/*
2527
# Install toolchains in /opt
2628
RUN curl downloads.arduino.cc/tools/internal/toolchains.tar.gz | tar -xz "opt"
@@ -52,7 +54,7 @@ RUN CROSS_COMPILE=x86_64-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
5254
CROSS_COMPILE=i686-ubuntu16.04-linux-gnu /opt/lib/build_libs.sh && \
5355
CROSS_COMPILE=i686-w64-mingw32 /opt/lib/build_libs.sh && \
5456
# CROSS_COMPILER is used to override the compiler
55-
CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 /opt/lib/build_libs.sh
57+
CROSS_COMPILER=o64-clang CROSS_COMPILE=x86_64-apple-darwin13 AR=/opt/osxcross/target/bin/x86_64-apple-darwin13-ar RANLIB=/opt/osxcross/target/bin/x86_64-apple-darwin13-ranlib /opt/lib/build_libs.sh
5658

5759
FROM ubuntu:latest
5860
# Copy all the installed toolchains and compiled libs
@@ -72,6 +74,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
7274
mingw-w64 \
7375
pkg-config \
7476
tar \
77+
bison \
78+
flex \
7579
&& rm -rf /var/lib/apt/lists/*
7680
# Set toolchains paths
7781
# arm-linux-gnueabihf-gcc -> linux_arm

deps/build_libs.sh

Lines changed: 105 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,115 @@
1-
#!/bin/bash
1+
#!/bin/bash -ex
2+
3+
export PREFIX=/opt/lib/${CROSS_COMPILE}
24

35
if [ x$CROSS_COMPILER == x ]; then
46
CROSS_COMPILER=${CROSS_COMPILE}-gcc
7+
CROSS_COMPILER_CXX=${CROSS_COMPILE}-g++
8+
# AR=${CROSS_COMPILE}-ar
59
else
610
export CC=$CROSS_COMPILER
7-
fi
8-
# udev lib not required for macos
9-
if [[ ${CROSS_COMPILE} != *apple* ]]; then
10-
cd /opt/lib/eudev-3.2.10
11-
export UDEV_DIR=`pwd`
12-
./autogen.sh
13-
./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --host=${CROSS_COMPILE}
14-
make clean
15-
make -j4
16-
cd ..
17-
export CFLAGS="-I$UDEV_DIR/src/libudev/"
18-
export LDFLAGS="-L$UDEV_DIR/src/libudev/.libs/"
19-
export LIBS="-ludev"
11+
export CXX=$CROSS_COMPILER++
12+
CROSS_COMPILER=$CC
13+
CROSS_COMPILER_CXX=$CXX
2014
fi
2115
cd /opt/lib/libusb-1.0.20
2216
export LIBUSB_DIR=`pwd`
23-
./configure --enable-static --disable-shared --host=${CROSS_COMPILE}
24-
make clean
17+
./configure --prefix=${PREFIX} --disable-udev --enable-static --disable-shared --host=${CROSS_COMPILE}
18+
make distclean
19+
./configure --prefix=${PREFIX} --disable-udev --enable-static --disable-shared --host=${CROSS_COMPILE}
20+
make
21+
make install
22+
23+
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
24+
25+
if [[ $CROSS_COMPILE == "i686-w64-mingw32" ]] ; then
26+
# libusb-compat is a mess to compile for win32
27+
# use a precompiled version from libusb-win32 project
28+
curl http://download.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip -o libusb-win32-bin-1.2.6.0.zip -L
29+
unzip libusb-win32-bin-1.2.6.0.zip
30+
#mkdir -p $PREFIX/bin/
31+
#cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll $PREFIX/bin/libusb0.dll
32+
cp libusb-win32-bin-1.2.6.0/include/lusb0_usb.h $PREFIX/include
33+
cp libusb-win32-bin-1.2.6.0/lib/gcc/libusb.a $PREFIX/lib
34+
else
35+
if [[ $CROSS_COMPILE == "x86_64-apple-darwin13" ]]; then
36+
export LIBUSB_1_0_CFLAGS=-I${PREFIX}/include/libusb-1.0
37+
export LIBUSB_1_0_LIBS="-L${PREFIX}/lib -lusb-1.0"
38+
fi
39+
cd /opt/lib/libusb-compat-0.1.5
40+
export LIBUSB0_DIR=`pwd`
41+
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" ./configure --prefix=${PREFIX} --enable-static --disable-shared --host=${CROSS_COMPILE}
42+
make distclean
43+
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" ./configure --prefix=${PREFIX} --enable-static --disable-shared --host=${CROSS_COMPILE}
44+
make
45+
make install
46+
fi
47+
48+
cd /opt/lib/libftdi1-1.4
49+
rm -rf build && mkdir build && cd build
50+
51+
CMAKE_EXTRA_FLAG="-DSHAREDLIBS=OFF -DBUILD_TESTS=OFF -DPYTHON_BINDINGS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF"
52+
53+
if [[ $CROSS_COMPILE == "i686-w64-mingw32" ]] ; then
54+
CMAKE_EXTRA_FLAG="$CMAKE_EXTRA_FLAG -DCMAKE_TOOLCHAIN_FILE=./cmake/Toolchain-i686-w64-mingw32.cmake"
55+
fi
56+
57+
if [[ $CROSS_COMPILE == "x86_64-apple-darwin13" ]]; then
58+
CMAKE_EXTRA_FLAG="$CMAKE_EXTRA_FLAG -DCMAKE_AR=$AR -DCMAKE_RANLIB=$RANLIB"
59+
fi
60+
61+
cmake -DCMAKE_C_COMPILER=$CROSS_COMPILER -DCMAKE_CXX_COMPILER=$CROSS_COMPILER_CXX -DCMAKE_INSTALL_PREFIX="$PREFIX" $CMAKE_EXTRA_FLAG -DLIBUSB_INCLUDE_DIR="$PREFIX/include/libusb-1.0" -DLIBFTDI_LIBRARY_DIRS="$PREFIX/lib" -DLIBUSB_LIBRARIES="usb-1.0" ../
2562
make
26-
cd ..
27-
# libusbudev.a merged not required for macos
28-
if [[ ${CROSS_COMPILE} != *apple* ]]; then
29-
mkdir -p ${CROSS_COMPILE}/libusb
30-
mkdir -p ${CROSS_COMPILE}/libudev
31-
cd ${CROSS_COMPILE}/libusb/
32-
ar -x ../../libusb-1.0.20/libusb/.libs/libusb-1.0.a
33-
cd ../libudev/
34-
ar -x ../../eudev-3.2.10/src/libudev/.libs/libudev.a
35-
cd ..
36-
ar -qc libusbudev.a libudev/* libusb/*
63+
make install
64+
65+
cd /opt/lib/libelf-0.8.13
66+
export LIBELF_DIR=`pwd`
67+
./configure --disable-shared --host=$CROSS_COMPILE --prefix=${PREFIX}
68+
make distclean
69+
./configure --disable-shared --host=$CROSS_COMPILE --prefix=${PREFIX}
70+
make
71+
make install
72+
73+
echo "*****************"
74+
file ${PREFIX}/lib/*
75+
echo "*****************"
76+
77+
export CPPFLAGS="-P"
78+
79+
cd /opt/lib/ncurses-5.9
80+
export NCURSES_DIR=`pwd`
81+
82+
./configure $EXTRAFLAGS --disable-shared --without-debug --without-ada --with-termlib --enable-termcap --without-manpages --without-progs --without-tests --host=$CROSS_COMPILE --prefix=${PREFIX}
83+
make distclean
84+
./configure $EXTRAFLAGS --disable-shared --without-debug --without-ada --with-termlib --enable-termcap --without-manpages --without-progs --without-tests --host=$CROSS_COMPILE --prefix=${PREFIX}
85+
make
86+
make install.libs
87+
88+
cd /opt/lib/readline-8.0
89+
export READLINE_DIR=`pwd`
90+
./configure --prefix=$PREFIX --disable-shared --host=$CROSS_COMPILE
91+
make distclean
92+
./configure --prefix=$PREFIX --disable-shared --host=$CROSS_COMPILE
93+
make
94+
make install-static
95+
96+
if [[ $CROSS_COMPILE != "i686-w64-mingw32" && $CROSS_COMPILE != "x86_64-apple-darwin13" ]] ; then
97+
cd /opt/lib/eudev-3.2.10
98+
./autogen.sh
99+
./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX --host=${CROSS_COMPILE}
100+
make distclean
101+
./autogen.sh
102+
./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX --host=${CROSS_COMPILE}
103+
make
104+
make install
37105
fi
106+
107+
cd /opt/lib/hidapi
108+
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
109+
./bootstrap
110+
./configure --prefix=$PREFIX --enable-static --disable-shared --host=$CROSS_COMPILE
111+
make distclean
112+
./bootstrap
113+
./configure --prefix=$PREFIX --enable-static --disable-shared --host=$CROSS_COMPILE
114+
make
115+
make install

deps/eudev-3.2.10/autogen.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/bin/sh
22

33
autoreconf -f -i -s
4-
5-
cd man
6-
./make.sh

deps/hidapi/.appveyor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
os: Visual Studio 2015
2+
3+
environment:
4+
matrix:
5+
- BUILD_ENV: msbuild
6+
arch: x64
7+
- BUILD_ENV: msbuild
8+
arch: Win32
9+
- BUILD_ENV: cygwin
10+
11+
install:
12+
- cmd: if %BUILD_ENV%==cygwin (
13+
C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake )
14+
15+
build_script:
16+
- cmd: if %BUILD_ENV%==msbuild (
17+
msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" )
18+
- cmd: if %BUILD_ENV%==cygwin (
19+
C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make" )
20+
21+
artifacts:
22+
# Win32 artifacts
23+
- path: .\windows\Release\hidapi.dll
24+
- path: .\windows\Release\hidapi.lib
25+
- path: .\windows\Release\hidapi.pdb
26+
- path: .\windows\Release\hidtest.exe
27+
- path: .\windows\Release\hidtest.pdb
28+
# x64 artifacts
29+
- path: .\windows\x64\Release\hidapi.dll
30+
- path: .\windows\x64\Release\hidapi.lib
31+
- path: .\windows\x64\Release\hidapi.pdb
32+
- path: .\windows\x64\Release\hidtest.exe
33+
- path: .\windows\x64\Release\hidtest.pdb

deps/hidapi/.builds/alpine.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
image: alpine/edge
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- eudev-dev
7+
- libusb-dev
8+
- linux-headers
9+
sources:
10+
- https://github.com/libusb/hidapi
11+
tasks:
12+
- setup: |
13+
cd hidapi
14+
./bootstrap
15+
./configure
16+
- build: |
17+
cd hidapi
18+
make
19+
make DESTDIR=$PWD/root install
20+
make clean
21+
- build-manual: |
22+
cd hidapi/linux
23+
make -f Makefile-manual
24+
cd ../libusb
25+
make -f Makefile-manual

deps/hidapi/.builds/archlinux.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
image: archlinux
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- libusb
7+
- libudev0
8+
sources:
9+
- https://github.com/libusb/hidapi
10+
tasks:
11+
- setup: |
12+
cd hidapi
13+
./bootstrap
14+
./configure
15+
- build: |
16+
cd hidapi
17+
make
18+
make DESTDIR=$PWD/root install
19+
make clean
20+
- build-manual: |
21+
cd hidapi/linux
22+
make -f Makefile-manual
23+
cd ../libusb
24+
make -f Makefile-manual
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
image: fedora/latest
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- mingw64-gcc
7+
- mingw64-gcc-c++
8+
sources:
9+
- https://github.com/libusb/hidapi
10+
tasks:
11+
- setup: |
12+
cd hidapi
13+
./bootstrap
14+
mingw64-configure
15+
- build: |
16+
cd hidapi
17+
make
18+
make DESTDIR=$PWD/root install
19+
make clean
20+
- build-manual: |
21+
cd hidapi/windows
22+
make -f Makefile-manual OS=MINGW CC=x86_64-w64-mingw32-gcc

deps/hidapi/.builds/freebsd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
image: freebsd/latest
2+
packages:
3+
- autoconf
4+
- automake
5+
- gmake
6+
- libiconv
7+
- libtool
8+
- pkgconf
9+
sources:
10+
- https://github.com/libusb/hidapi
11+
tasks:
12+
- setup: |
13+
cd hidapi
14+
./bootstrap
15+
./configure
16+
- build: |
17+
cd hidapi
18+
make
19+
make DESTDIR=$PWD/root install
20+
make clean
21+
- build-manual: |
22+
cd hidapi/libusb
23+
gmake -f Makefile-manual

deps/hidapi/.cirrus.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
alpine_task:
2+
container:
3+
image: alpine:latest
4+
install_script: apk add autoconf automake g++ gcc libusb-dev libtool linux-headers eudev-dev make musl-dev
5+
script:
6+
- ./bootstrap
7+
- ./configure || { cat config.log; exit 1; }
8+
- make
9+
- make install
10+
11+
freebsd11_task:
12+
freebsd_instance:
13+
image: freebsd-11-2-release-amd64
14+
install_script:
15+
- pkg install -y
16+
autoconf automake libiconv libtool pkgconf
17+
script:
18+
- ./bootstrap
19+
- ./configure || { cat config.log; exit 1; }
20+
- make
21+
- make install
22+
23+
freebsd12_task:
24+
freebsd_instance:
25+
image: freebsd-12-1-release-amd64
26+
install_script:
27+
- pkg install -y
28+
autoconf automake libiconv libtool pkgconf
29+
script:
30+
- ./bootstrap
31+
- ./configure || { cat config.log; exit 1; }
32+
- make
33+
- make install

deps/hidapi/AUTHORS.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
HIDAPI Authors:
3+
4+
Alan Ott <[email protected]>:
5+
Original Author and Maintainer
6+
Linux, Windows, and Mac implementations
7+
8+
Ludovic Rousseau <[email protected]>:
9+
Formatting for Doxygen documentation
10+
Bug fixes
11+
Correctness fixes
12+
13+
libusb/hidapi Team:
14+
Development/maintainance since June 4th 2019
15+
16+
For a comprehensive list of contributions, see the commit list at github:
17+
https://github.com/libusb/hidapi/graphs/contributors
18+

0 commit comments

Comments
 (0)