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

bneradt 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 a8a706988a build_h3_tools: update for lib64 (#9946)
a8a706988a is described below

commit a8a706988a53ad7a635e521a9329a498f9e26b58
Author: Brian Neradt <[email protected]>
AuthorDate: Wed Jul 5 11:45:49 2023 -0500

    build_h3_tools: update for lib64 (#9946)
    
    On some systems, such as amd64 Linux, OpenSSL 3.0 installs into a lib64
    directory instead of lib. This updates the build_h3_tools for this.
---
 tools/build_h3_tools.sh | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tools/build_h3_tools.sh b/tools/build_h3_tools.sh
index a518242782..33ffa6d76f 100755
--- a/tools/build_h3_tools.sh
+++ b/tools/build_h3_tools.sh
@@ -37,10 +37,8 @@ OPENSSL_BASE=${OPENSSL_BASE:-"${BASE}/openssl-quic"}
 OPENSSL_PREFIX=${OPENSSL_PREFIX:-"${OPENSSL_BASE}-${OPENSSL_BRANCH}"}
 MAKE="make"
 
-# These are for Linux like systems, specially the LDFLAGS, also depends on 
dirs above
 CFLAGS=${CFLAGS:-"-O3 -g"}
 CXXFLAGS=${CXXFLAGS:-"-O3 -g"}
-LDFLAGS=${LDFLAGS:-"-Wl,-rpath,${OPENSSL_PREFIX}/lib"}
 
 if [ -e /etc/redhat-release ]; then
     MAKE="gmake"
@@ -159,6 +157,17 @@ sudo ${MAKE} install_sw
 sudo ln -sf ${OPENSSL_PREFIX} ${OPENSSL_BASE}
 cd ..
 
+# OpenSSL will install in /lib or lib64 depending upon the architecture.
+if [ -f "${OPENSSL_PREFIX}/lib/libssl.so" ]; then
+  OPENSSL_LIB="${OPENSSL_PREFIX}/lib"
+elif [ -f "${OPENSSL_PREFIX}/lib64/libssl.so" ]; then
+  OPENSSL_LIB="${OPENSSL_PREFIX}/lib64"
+else
+  echo "Could not find the OpenSSL install library directory."
+  exit 1
+fi
+LDFLAGS=${LDFLAGS:-"-Wl,-rpath,${OPENSSL_LIB}"}
+
 # Then nghttp3
 echo "Building nghttp3..."
 if [ ! -d nghttp3 ]; then
@@ -170,7 +179,7 @@ cd nghttp3
 autoreconf -if
 ./configure \
   --prefix=${BASE} \
-  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \
+  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_LIB}/pkgconfig \
   CFLAGS="${CFLAGS}" \
   CXXFLAGS="${CXXFLAGS}" \
   LDFLAGS="${LDFLAGS}" \
@@ -190,7 +199,7 @@ cd ngtcp2
 autoreconf -if
 ./configure \
   --prefix=${BASE} \
-  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \
+  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_LIB}/pkgconfig \
   CFLAGS="${CFLAGS}" \
   CXXFLAGS="${CXXFLAGS}" \
   LDFLAGS="${LDFLAGS}" \
@@ -222,7 +231,7 @@ 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 \
+  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_LIB}/pkgconfig \
   CFLAGS="${CFLAGS}" \
   CXXFLAGS="${CXXFLAGS}" \
   LDFLAGS="${LDFLAGS}" \

Reply via email to