]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
FreeBSD build fixes and basic CI build with eapol_test checks (#3825)
authorTerry Burton <tez@terryburton.co.uk>
Wed, 30 Dec 2020 20:34:52 +0000 (20:34 +0000)
committerGitHub <noreply@github.com>
Wed, 30 Dec 2020 20:34:52 +0000 (20:34 +0000)
* FreeBSD build fixes

* Fix eapol_test build options

Enable CONFIG_EAP_SIM on FreeBSD.
"n" means yes!

* Remove bashisms from eapol_test-build

* CI: FreeBSD build

.github/workflows/ci-freebsd.yml [new file with mode: 0644]
scripts/build/dlopen.c
scripts/ci/eapol_test-build.sh
scripts/ci/eapol_test/config_freebsd
scripts/ci/eapol_test/config_linux
scripts/ci/eapol_test/config_osx
src/lib/unlang/tmpl.c

diff --git a/.github/workflows/ci-freebsd.yml b/.github/workflows/ci-freebsd.yml
new file mode 100644 (file)
index 0000000..2024d15
--- /dev/null
@@ -0,0 +1,33 @@
+name: CI FreeBSD
+
+on:
+  push:
+    branches:
+      - packaging_test
+  schedule:
+    - cron: '0 20 * * *'
+
+jobs:
+  freebsd-build:
+
+    runs-on: macos-latest
+
+    name: "FreeBSD build"
+
+    steps:
+
+    - uses: actions/checkout@v2
+      with:
+        path: freeradius
+
+    - name: Test using a FreeBSD VirtualBox VM
+      uses: vmactions/freebsd-vm@v0.0.9
+      with:
+        usesh: true
+        prepare: pkg install -y gmake talloc git
+        run: |
+          freebsd-version
+          cd freeradius
+          ./configure
+          gmake -j `sysctl -n hw.ncpu`
+          gmake test.eap
index 9522ceb647652c711b0173a1cde177ac7017680f..98ded1f278d01288d0ad7f1a7daf39ada6c55957 100644 (file)
@@ -36,7 +36,7 @@ RCSID("$Id$")
 
 #include "log.h"
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 #include <link.h>
 #endif
 
index 87de735edc9ec67ec647ce3d78ebfe592a23f0e9..a8e6ce25bccbc2ac1d5a2b06868f5cd9be75174a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /bin/sh
 
 #
 #  This program is is free software; you can redistribute it and/or modify
@@ -37,6 +37,7 @@ TMP_BUILD_DIR="${BUILD_DIR}"
 : ${HOSTAPD_GIT_TAG:="hostap_2_8"}
 : ${WPA_SUPPLICANT_DIR:="${HOSTAPD_DIR}/wpa_supplicant"}
 
+: ${MAKE:=make}
 : ${BUILD_CONF_DIR:="$(dirname $0)/eapol_test"}
 : ${EAPOL_TEST_PATH:="${BUILD_CONF_DIR}/eapol_test"}
 
@@ -53,27 +54,30 @@ if [ -z "${FORCE_BUILD}" ]; then
     fi
 fi
 
-case "$OSTYPE" in
-linux-gnu)
+OS="$(uname)"
+
+case "$OS" in
+linux-gnu|Linux)
     BUILD_CONF_FILE="${BUILD_CONF_DIR}/config_linux"
     ;;
 
-darwin*)
+darwin*|Darwin*)
     BUILD_CONF_FILE="${BUILD_CONF_DIR}/config_osx"
     ;;
 
-freebsd*)
+freebsd*|FreeBSD*)
     BUILD_CONF_FILE="${BUILD_CONF_DIR}/config_freebsd"
+    MAKE=gmake
     ;;
 
 *)
-    echo "Don't have specific eapol_test build config for OS $OSTYPE.  Using linux build config"
+    echo "Don't have specific eapol_test build config for OS $OS.  Using linux build config"
     BUILD_CONF_FILE="${BUILD_CONF_DIR}/linux"
     ;;
 esac
 
 if [ ! -e "${BUILD_CONF_FILE}" ]; then
-    echo "Missing build config file \"${BUILD_CONF_FILE}\" for OS $OSTYPE, please contribute one" 1>&2
+    echo "Missing build config file \"${BUILD_CONF_FILE}\" for OS $OS, please contribute one" 1>&2
     exit 1
 fi
 
@@ -86,7 +90,7 @@ fi
 
 cp "$BUILD_CONF_FILE" "$WPA_SUPPLICANT_DIR/.config"
 
-if ! make -C "${WPA_SUPPLICANT_DIR}" -j8 eapol_test 1>&2 || [ ! -e "${WPA_SUPPLICANT_DIR}/eapol_test" ]; then
+if ! ${MAKE} -C "${WPA_SUPPLICANT_DIR}" -j8 eapol_test 1>&2 || [ ! -e "${WPA_SUPPLICANT_DIR}/eapol_test" ]; then
     echo "Build error" 1>&2
     if [ -z "${BUILD_DIR}" ]; then rm -rf "$TMP_BUILD_DIR"; fi
     exit 1
index 3a61525cd5c01712887358b35f3d7dcc1e43fd6c..5aa043b03ed4897770cf80e020529d03f913ff26 100644 (file)
@@ -24,13 +24,13 @@ CFLAGS += -g3 -O0 -Wno-error=deprecated-declarations
 # replacement for WEXT and its use allows wpa_supplicant to properly control
 # the driver to improve existing functionality like roaming and to support new
 # functionality.
-CONFIG_DRIVER_WEXT=n
+CONFIG_DRIVER_WEXT=
 
 # Driver interface for Linux drivers using the nl80211 kernel interface
-CONFIG_DRIVER_NL80211=n
+CONFIG_DRIVER_NL80211=
 
 # QCA vendor extensions to nl80211
-CONFIG_DRIVER_NL80211_QCA=n
+CONFIG_DRIVER_NL80211_QCA=
 
 # driver_nl80211.c requires libnl. If you are compiling it yourself
 # you may need to point hostapd to your version of libnl.
@@ -113,7 +113,7 @@ CONFIG_EAP_GTC=y
 CONFIG_EAP_OTP=y
 
 # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
-#CONFIG_EAP_SIM=y
+CONFIG_EAP_SIM=y
 
 # EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
 CONFIG_EAP_PSK=y
@@ -125,7 +125,7 @@ CONFIG_EAP_PWD=y
 CONFIG_EAP_PAX=y
 
 # LEAP
-CONFIG_EAP_LEAP=n
+CONFIG_EAP_LEAP=
 
 # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
 CONFIG_EAP_AKA=y
index 5c46ea24d17e81e5e9c83e6ed5d63b9201e08a02..b21ed2f358a9a17eb900fc016c1a12d06740030c 100644 (file)
@@ -24,13 +24,13 @@ CFLAGS += -g3 -O0 -Wno-error=deprecated-declarations
 # replacement for WEXT and its use allows wpa_supplicant to properly control
 # the driver to improve existing functionality like roaming and to support new
 # functionality.
-CONFIG_DRIVER_WEXT=n
+CONFIG_DRIVER_WEXT=
 
 # Driver interface for Linux drivers using the nl80211 kernel interface
-CONFIG_DRIVER_NL80211=n
+CONFIG_DRIVER_NL80211=
 
 # QCA vendor extensions to nl80211
-CONFIG_DRIVER_NL80211_QCA=n
+CONFIG_DRIVER_NL80211_QCA=
 
 # driver_nl80211.c requires libnl. If you are compiling it yourself
 # you may need to point hostapd to your version of libnl.
@@ -125,7 +125,7 @@ CONFIG_EAP_PWD=y
 CONFIG_EAP_PAX=y
 
 # LEAP
-CONFIG_EAP_LEAP=n
+CONFIG_EAP_LEAP=
 
 # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
 CONFIG_EAP_AKA=y
index eb3aa352d9e21ee3f1b381e27282f2902ae75b76..18ccbb70177a61d4609e8abaac3c905c17515bc9 100644 (file)
@@ -24,13 +24,13 @@ LIBS += -L/usr/local/opt/openssl/lib -L/usr/local/lib
 # replacement for WEXT and its use allows wpa_supplicant to properly control
 # the driver to improve existing functionality like roaming and to support new
 # functionality.
-CONFIG_DRIVER_WEXT=n
+CONFIG_DRIVER_WEXT=
 
 # Driver interface for Linux drivers using the nl80211 kernel interface
-CONFIG_DRIVER_NL80211=n
+CONFIG_DRIVER_NL80211=
 
 # QCA vendor extensions to nl80211
-CONFIG_DRIVER_NL80211_QCA=n
+CONFIG_DRIVER_NL80211_QCA=
 
 # driver_nl80211.c requires libnl. If you are compiling it yourself
 # you may need to point hostapd to your version of libnl.
@@ -125,7 +125,7 @@ CONFIG_EAP_PWD=y
 CONFIG_EAP_PAX=y
 
 # LEAP
-CONFIG_EAP_LEAP=n
+CONFIG_EAP_LEAP=
 
 # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
 CONFIG_EAP_AKA=y
index ac5e38f265e31574df84cb66659e7c9ec8b7b3c3..716ec8432b5f08ae8276e4e40f2768674841f234 100644 (file)
@@ -32,7 +32,7 @@ RCSID("$Id$")
 #include "tmpl_priv.h"
 #include <signal.h>
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 #include <sys/wait.h>
 #endif