Skip to content

Commit 37d31d1

Browse files
committed
Fix ARM cross-compilation: use custom prefix for libmicrohttpd
The ARM cross-compiler doesn't search /usr/local by default. Install libmicrohttpd to a workspace-local sysroot and pass CPPFLAGS/LDFLAGS to libhttpserver's configure to find the headers and libraries.
1 parent d235f39 commit 37d31d1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/verify-build.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,19 +571,22 @@ jobs:
571571
tar -xzf libmicrohttpd-0.9.77.tar.gz
572572
mv libmicrohttpd-0.9.77 libmicrohttpd-0.9.77-${{ matrix.build-type }}
573573
cd libmicrohttpd-0.9.77-${{ matrix.build-type }}
574+
mkdir -p ${{ github.workspace }}/arm-sysroot
574575
if [ "${{ matrix.build-type }}" = "arm32" ]; then
575-
./configure --host=arm-linux-gnueabihf --disable-examples --disable-doc
576+
./configure --host=arm-linux-gnueabihf --prefix=${{ github.workspace }}/arm-sysroot --disable-examples --disable-doc
576577
else
577-
./configure --host=aarch64-linux-gnu --disable-examples --disable-doc
578+
./configure --host=aarch64-linux-gnu --prefix=${{ github.workspace }}/arm-sysroot --disable-examples --disable-doc
578579
fi
579580
make
581+
make install
580582
if: ${{ matrix.compiler-family == 'arm-cross' && steps.cache-libmicrohttpd-arm.outputs.cache-hit != 'true' }}
581583

582-
- name: Install cross-compiled libmicrohttpd
584+
- name: Install cross-compiled libmicrohttpd from cache
583585
run: |
584586
cd libmicrohttpd-0.9.77-${{ matrix.build-type }}
585-
sudo make install
586-
if: ${{ matrix.compiler-family == 'arm-cross' }}
587+
mkdir -p ${{ github.workspace }}/arm-sysroot
588+
make install
589+
if: ${{ matrix.compiler-family == 'arm-cross' && steps.cache-libmicrohttpd-arm.outputs.cache-hit == 'true' }}
587590

588591
- name: Refresh links to shared libs
589592
run: sudo ldconfig ;
@@ -612,6 +615,9 @@ jobs:
612615
mkdir build ;
613616
cd build ;
614617
if [ "${{ matrix.compiler-family }}" = "arm-cross" ]; then
618+
export CPPFLAGS="-I${{ github.workspace }}/arm-sysroot/include"
619+
export LDFLAGS="-L${{ github.workspace }}/arm-sysroot/lib"
620+
export PKG_CONFIG_PATH="${{ github.workspace }}/arm-sysroot/lib/pkgconfig"
615621
if [ "${{ matrix.build-type }}" = "arm32" ]; then
616622
../configure --host=arm-linux-gnueabihf --disable-fastopen;
617623
else

0 commit comments

Comments
 (0)