Skip to content

Commit

Permalink
Merge main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusgreuel committed Jan 9, 2023
2 parents 15fe12b + a8931a4 commit 8b147b4
Show file tree
Hide file tree
Showing 129 changed files with 37,978 additions and 25,359 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ jobs:
linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
sudo apt-get update
sudo apt-get install -y
build-essential
cmake
Expand All @@ -47,9 +49,14 @@ jobs:
libusb-1.0-0-dev
libhidapi-dev
libftdi1-dev
libreadline-dev
texinfo
texlive
texi2html
- name: Configure
run: >-
cmake
-D BUILD_DOC=1
-D DEBUG_CMAKE=1
-D HAVE_LINUXGPIO=1
-D HAVE_LINUXSPI=1
Expand All @@ -59,15 +66,15 @@ jobs:
run: cmake --build build
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-linux-x86_64
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: avrdude-linux-x86_64
path: |
Expand All @@ -84,13 +91,15 @@ jobs:
- { arch: armhf, processor: armhf, prefix: arm-linux-gnueabihf, inc-lib: arm-linux-gnueabihf }
- { arch: arm64, processor: aarch64, prefix: aarch64-linux-gnu, inc-lib: aarch64-linux-gnu }
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Add architecture
run: |
dpkg --add-architecture ${{matrix.arch}}
apt-get update
- name: Install prerequisites
run: >-
apt-get update
apt-get install -y
git
cmake
Expand All @@ -102,6 +111,7 @@ jobs:
libusb-1.0-0-dev:${{matrix.arch}}
libhidapi-dev:${{matrix.arch}}
libftdi1-dev:${{matrix.arch}}
libreadline-dev:${{matrix.arch}}
- name: Configure
run: >-
cmake
Expand All @@ -120,15 +130,15 @@ jobs:
run: cmake --build build
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-linux-${{matrix.processor}}
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: avrdude-linux-${{matrix.processor}}
path: |
Expand All @@ -138,9 +148,11 @@ jobs:
macos-x86_64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install prerequisites
run: >-
# brew update
brew install
cmake
flex
Expand All @@ -149,6 +161,7 @@ jobs:
libusb
hidapi
libftdi
readline
- name: Configure
run: >-
cmake
Expand All @@ -161,15 +174,15 @@ jobs:
run: cmake --build build
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-macos-x86_64
path: |
build/
!**/*.d
!**/*.o
- name: Archive executables
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: avrdude-macos-x86_64
path: |
Expand All @@ -185,7 +198,7 @@ jobs:
- { arch: x64, platform: x64 }
- { arch: arm64, platform: ARM64 }
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install prerequisites
# As Chocolatey is notoriously unreliable, install winflexbison3 directly from GitHub.
# run: choco install winflexbison3
Expand All @@ -202,14 +215,15 @@ jobs:
-D CMAKE_C_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
-D CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="/DEBUG /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF"
-D HAVE_LIBREADLINE=HAVE_LIBREADLINE-NOTFOUND
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-D USE_EXTERNAL=1
-D USE_EXTERNAL_LIBS=1
-B build
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-msvc-${{matrix.arch}}
path: |
Expand All @@ -221,7 +235,7 @@ jobs:
mv build/src/RelWithDebInfo/avrdude.exe build/src
mv build/src/RelWithDebInfo/avrdude.pdb build/src
- name: Archive executables
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: avrdude-msvc-${{matrix.arch}}
path: |
Expand All @@ -240,7 +254,7 @@ jobs:
- { sys: mingw32, env: i686 }
- { sys: mingw64, env: x86_64 }
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
Expand All @@ -265,13 +279,13 @@ jobs:
run: cmake --build build
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-mingw-${{matrix.env}}
path: |
build/
- name: Archive executables
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: avrdude-mingw-${{matrix.env}}
path: |
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,3 @@ jobs:
asset_path: ./asset.zip
asset_name: avrdude-${{github.ref_name}}-windows-${{matrix.arch}}.zip
asset_content_type: application/zip

#deploy:
# needs: [asset-msvc]
# runs-on: ubuntu-latest
# steps:
# - name: Create package (Chocolatey)
# run: echo TODO
12 changes: 11 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ AVRDUDE was written by:

Brian S. Dean <[email protected]>

AVRDUDE is currently maintained by:

Hans Eirik Bull
Stefan Rueger
Xiaofan Chen
Marius Greuel
Joerg Wunsch

Contributors:

Joerg Wunsch <[email protected]>
Expand Down Expand Up @@ -29,12 +37,14 @@ Contributors:
Marius Greuel <[email protected]>
Dawid Buchwald <[email protected]>
Hans Eirik Bull
Stefan Rueger
Xiaofan Chen

Contributors to code no longer present:

Dale Roberts for the giveio driver
Paula Tomlinson for the loaddrv sources
Chris Liechti for loaddrv modifications

For minor contributions, please see the ChangeLog files.
For minor contributions, please see the ChangeLog files / Git log.

57 changes: 28 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# cmake -B build
# cmake --build build

cmake_minimum_required(VERSION 3.12)
project(avrdude VERSION 7.0)
cmake_minimum_required(VERSION 3.14)
project(avrdude VERSION 7.1 LANGUAGES C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
Expand All @@ -30,11 +30,18 @@ option(BUILD_DOC "Enable building documents" OFF)
option(HAVE_LINUXGPIO "Enable Linux sysfs GPIO support" OFF)
option(HAVE_LINUXSPI "Enable Linux SPI support" OFF)
option(HAVE_PARPORT "Enable parallel port support" OFF)
option(USE_EXTERNAL "Use external libraries from AVRDUDE GitHub repositories" OFF)
option(USE_EXTERNAL_LIBS "Use external libraries from AVRDUDE GitHub repositories" OFF)
option(USE_LIBUSBWIN32 "Prefer libusb-win32 over libusb" OFF)
option(DEBUG_CMAKE "Enable debugging output for this CMake project" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

if(WIN32)
# Prefer static libraries over DLLs on Windows
option(USE_STATIC_LIBS "Use static libraries" ON)
else()
option(USE_STATIC_LIBS "Use static libraries" OFF)
endif()

include(CheckIncludeFile)
include(CheckSymbolExists)
include(FetchContent)
Expand Down Expand Up @@ -110,21 +117,22 @@ endif()
# Detect installed libraries
# =====================================

# Prefer static libraries over DLLs on Windows
if(WIN32)
if(USE_STATIC_LIBS)
set(PREFERRED_LIBELF libelf.a elf)
set(PREFERRED_LIBUSB libusb.a usb)
set(PREFERRED_LIBUSB_1_0 libusb-1.0.a usb-1.0)
set(PREFERRED_LIBHIDAPI libhidapi.a libhidapi-libusb.a libhidapi-hidraw.a hidapi hidapi-libusb hidapi-hidraw)
set(PREFERRED_LIBFTDI libftdi.a ftdi)
set(PREFERRED_LIBFTDI1 libftdi1.a ftdi1)
set(PREFERRED_LIBREADLINE libreadline.a)
else()
set(PREFERRED_LIBELF elf)
set(PREFERRED_LIBUSB usb)
set(PREFERRED_LIBUSB_1_0 usb-1.0)
set(PREFERRED_LIBHIDAPI hidapi hidapi-libusb hidapi-hidraw)
set(PREFERRED_LIBFTDI ftdi)
set(PREFERRED_LIBFTDI1 ftdi1)
set(PREFERRED_LIBREADLINE readline)
endif()

# -------------------------------------
Expand Down Expand Up @@ -212,16 +220,18 @@ endif()
# -------------------------------------
# Find libreadline

find_library(HAVE_LIBREADLINE NAMES readline)
find_library(HAVE_LIBREADLINE NAMES ${PREFERRED_LIBREADLINE})
if(HAVE_LIBREADLINE)
set(LIB_LIBREADLINE ${HAVE_LIBREADLINE})
elseif(MSVC)
set(HAVE_LIBREADLINE 1)
endif()

# =====================================
# Use external libraries if requested
# =====================================

if(USE_EXTERNAL)
if(USE_EXTERNAL_LIBS)
FetchContent_Declare(libelf
GIT_REPOSITORY https://github.com/avrdudes/libelf.git
GIT_TAG e5a39bf19bd6598c42e09172be5a78ceec2a065c
Expand All @@ -234,12 +244,12 @@ if(USE_EXTERNAL)

FetchContent_Declare(libhidapi
GIT_REPOSITORY https://github.com/avrdudes/libhidapi.git
GIT_TAG e3700e951f762ef92871ff4fc94586e4d1c042a6
GIT_TAG d1307487973c857bc158e27ecc99644b2f5e68ea
)

FetchContent_Declare(libftdi
GIT_REPOSITORY https://github.com/avrdudes/libftdi.git
GIT_TAG f3a54da710002a7d25a32a69e667a69ef84cc120
GIT_TAG f9fe6e96b97c3a08efd081632c1859cb83aa14e3
)

message(STATUS "Fetching external libraries, please wait...")
Expand Down Expand Up @@ -273,25 +283,8 @@ endif()

add_subdirectory(src)

# =====================================
# Setup default port names
# =====================================

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DEFAULT_PAR_PORT "/dev/parport0")
set(DEFAULT_SER_PORT "/dev/ttyS0")
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(DEFAULT_PAR_PORT "/dev/ppi0")
set(DEFAULT_SER_PORT "/dev/cuad0")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris")
set(DEFAULT_PAR_PORT "/dev/printers/0")
set(DEFAULT_SER_PORT "/dev/term/a")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(DEFAULT_PAR_PORT "lpt1")
set(DEFAULT_SER_PORT "com1")
else()
set(DEFAULT_PAR_PORT "unknown")
set(DEFAULT_SER_PORT "unknown")
if(BUILD_DOC)
add_subdirectory(src/doc)
endif()

# =====================================
Expand All @@ -308,7 +301,7 @@ if (DEBUG_CMAKE)
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
message(STATUS "CONFIG_DIR: ${CONFIG_DIR}")
message(STATUS "AVRDUDE_FULL_VERSION: ${AVRDUDE_FULL_VERSION}")
message(STATUS "USE_EXTERNAL: ${USE_EXTERNAL}")
message(STATUS "USE_EXTERNAL_LIBS: ${USE_EXTERNAL_LIBS}")
message(STATUS "USE_LIBUSBWIN32: ${USE_LIBUSBWIN32}")
message(STATUS "HAVE_LIBELF: ${HAVE_LIBELF}")
message(STATUS "HAVE_LIBUSB: ${HAVE_LIBUSB}")
Expand Down Expand Up @@ -370,6 +363,12 @@ else()
message(STATUS "DON'T HAVE libftdi1")
endif()

if(HAVE_LIBREADLINE)
message(STATUS "DO HAVE libreadline")
else()
message(STATUS "DON'T HAVE libreadline")
endif()

if(BUILD_DOC)
message(STATUS "ENABLED doc")
else()
Expand Down
Loading

0 comments on commit 8b147b4

Please sign in to comment.