This is an automated email from the ASF dual-hosted git repository.

dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new f25357a05b build_h3_tools - Add support for FreeBSD. (#9920)
f25357a05b is described below

commit f25357a05baedd8039c85b4572e8b64de07c45d5
Author: Damian Meden <[email protected]>
AuthorDate: Wed Jun 28 18:05:02 2023 +0100

    build_h3_tools - Add support for FreeBSD. (#9920)
    
    The script now can be used in FreeBSD 13.1
---
 tools/build_h3_tools.sh | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/build_h3_tools.sh b/tools/build_h3_tools.sh
index 608e215a96..4f85238099 100755
--- a/tools/build_h3_tools.sh
+++ b/tools/build_h3_tools.sh
@@ -79,6 +79,9 @@ set -x
 if [ `uname -s` = "Linux" ]
 then
   num_threads=$(nproc)
+elif [ `uname -s` = "FreeBSD" ]
+then
+  num_threads=$(sysctl -n hw.ncpu)
 else
   # MacOS.
   num_threads=$(sysctl -n hw.logicalcpu)
@@ -98,6 +101,8 @@ fi
 
 if [ `uname -s` = "Darwin" ]; then
     OS="darwin"
+elif [ `uname -s` = "FreeBSD" ]; then
+    OS="freebsd"
 else
     OS="linux"
 fi
@@ -147,7 +152,7 @@ echo "Building OpenSSL with QUIC support"
 cd openssl-quic
 ./config enable-tls1_3 --prefix=${OPENSSL_PREFIX}
 ${MAKE} -j ${num_threads}
-sudo ${MAKE} -j install
+sudo ${MAKE} install
 
 # The symlink target provides a more convenient path for the user while also
 # providing, in the symlink source, the precise branch of the OpenSSL build.
@@ -206,13 +211,15 @@ if [ ! -d nghttp2 ]; then
 fi
 cd nghttp2
 autoreconf -if
-if [ `uname -s` = "Darwin" ]
+if [ `uname -s` = "Darwin" ] || [ `uname -s` = "FreeBSD" ]
 then
-  # --enable-app requires systemd which is not available on Mac.
+  # --enable-app requires systemd which is not available on Mac/FreeBSD.
   ENABLE_APP=""
 else
   ENABLE_APP="--enable-app"
 fi
+
+# Note for FreeBSD: This will not build h2load. h2load can be run on a remote 
machine.
 ./configure \
   --prefix=${BASE} \
   PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \

Reply via email to