necouchman commented on code in PR #575: URL: https://github.com/apache/guacamole-server/pull/575#discussion_r2052645637
########## src/guacd-docker/bin/autobuild.sh: ########## @@ -0,0 +1,144 @@ +#!/bin/sh -e +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +## +## @fn autobuild.sh +## +## Automatically builds the source of guacamole-server or its various core +## protocol library dependencies. Usage of GNU Autotools vs. CMake is +## automatically detected. Additional build options may be provided using +## environment variables, including architecture-specific options. +## +## @param VAR_BASE +## The text that should be used as the base for environment variables +## that control the build. The following variables will be read: +## +## - [VAR_BASE]_OPTS: Options that should be passed to the build regardless +## of architecture. +## +## - [VAR_BASE]_ARM_OPTS: Options that should be passed to the build only +## if built for ARM CPUs. +## +## - [VAR_BASE]_X86_OPTS: Options that should be passed to the build only +## if built for x86 (Intel, AMD) CPUs. +## +## - WITH_[VAR_BASE]: The git reference (tag, commit, etc.) that should be +## built, or a regular expression that matches the version tag that +## should be built (the largest-numbered tag will be chosen). This +## variable is only applicable if the source is being pulled from a git +## repository (the URL of a git repository is provided for LOCATION). +## +## @param LOCATION +## The location of the source to be used for the build. This may be a +## directory or the URL of a git repository. +## + +VAR_BASE="$1" +LOCATION="$2" + +# Pre-populate build control variables such that the custom build prefix is +# used for C headers, locating libraries, etc. +export CFLAGS="-I${PREFIX_DIR}/include" +export LDFLAGS="-L${PREFIX_DIR}/lib" +export PKG_CONFIG_PATH="${PREFIX_DIR}/lib/pkgconfig" + +# Ensure thread stack size will be 8 MB (glibc's default on Linux) rather than +# 128 KB (musl's default) +export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=8388608" + +PATTERN_VAR="WITH_${VAR_BASE}" +PATTERN="$(printenv "${PATTERN_VAR}" || true)" + +# Allow dependencies to be manually omitted with the tag/commit pattern "NO" +if [ "$PATTERN" = "NO" ]; then + echo "NOT building $REPO_DIR (explicitly skipped)" + exit +fi + +# Clone repository and change to top-level directory of source +if echo "$LOCATION" | grep -q '://'; then + cd /tmp + git clone "$LOCATION" + SRC_DIR="$(basename "$LOCATION" .git)" +else + SRC_DIR="$LOCATION" +fi + +# Determine architecture that we're building on +if [ -z "$BUILD_ARCHITECTURE" ]; then + case "$(uname -m)" in + armv6l|armv7l|aarch64) + BUILD_ARCHITECTURE="ARM" + ;; + x86_64) + BUILD_ARCHITECTURE="X86" Review Comment: I know 32-bit x86 has mostly gone away, but are there any known issues with Guacamole running in a 32-bit x86 environment? Should this be broadened to include both i686 and x86_64? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org