mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-06-10 18:29:43 +00:00
82 lines
1.7 KiB
Bash
Executable File
82 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
# This script provides an execution environment for mozconfig scripts.
|
|
# This script is not meant to be called by users. Instead, some
|
|
# higher-level driver invokes it and parses the machine-tailored output.
|
|
|
|
set -e
|
|
|
|
ac_add_options() {
|
|
local opt
|
|
for opt; do
|
|
case "$opt" in
|
|
--target=*)
|
|
echo "------BEGIN_MK_OPTION"
|
|
echo $opt | sed s/--target/CONFIG_GUESS/
|
|
echo "------END_MK_OPTION"
|
|
;;
|
|
esac
|
|
echo "------BEGIN_AC_OPTION"
|
|
echo $opt
|
|
echo "------END_AC_OPTION"
|
|
done
|
|
}
|
|
|
|
ac_add_app_options() {
|
|
local app
|
|
app=$1
|
|
shift
|
|
echo "------BEGIN_AC_APP_OPTION"
|
|
echo $app
|
|
echo "$*"
|
|
echo "------END_AC_APP_OPTION"
|
|
}
|
|
|
|
mk_add_options() {
|
|
local opt name op value
|
|
for opt; do
|
|
echo "------BEGIN_MK_OPTION"
|
|
echo $opt
|
|
# Remove any leading "export"
|
|
opt=${opt#export}
|
|
case "$opt" in
|
|
*\?=*) op="?=" ;;
|
|
*:=*) op=":=" ;;
|
|
*+=*) op="+=" ;;
|
|
*=*) op="=" ;;
|
|
esac
|
|
# Remove the operator and the value that follows
|
|
name=${opt%%${op}*}
|
|
# Note: $(echo ${name}) strips the variable from any leading and trailing
|
|
# whitespaces.
|
|
eval "$(echo ${name})_IS_SET=1"
|
|
echo "------END_MK_OPTION"
|
|
done
|
|
}
|
|
|
|
echo "------BEGIN_ENV_BEFORE_SOURCE"
|
|
env
|
|
echo "------END_ENV_BEFORE_SOURCE"
|
|
|
|
echo "------BEGIN_BEFORE_SOURCE"
|
|
set
|
|
echo "------END_BEFORE_SOURCE"
|
|
|
|
topsrcdir=$1
|
|
|
|
. $2
|
|
|
|
unset topsrcdir
|
|
|
|
echo "------BEGIN_AFTER_SOURCE"
|
|
set
|
|
echo "------END_AFTER_SOURCE"
|
|
|
|
echo "------BEGIN_ENV_AFTER_SOURCE"
|
|
env
|
|
echo "------END_ENV_AFTER_SOURCE"
|
|
|