build/autoconf/mozconfig2configure

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #! /bin/sh
     2 #
     3 # This Source Code Form is subject to the terms of the Mozilla Public
     4 # License, v. 2.0. If a copy of the MPL was not distributed with this
     5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7 # mozconfig2configure - Loads options from .mozconfig onto configure's
     8 #    command-line. See mozconfig-find for how the config file is
     9 #    found
    10 #
    11 #    The options from .mozconfig are inserted into the command-line
    12 #    before the real command-line options. This way the real options
    13 #    will override any .mozconfig options.
    14 #
    15 # .mozconfig is a shell script. To add an option to configure's
    16 #    command-line use the pre-defined function, ac_add_options,
    17 #
    18 #       ac_add_options  <configure-option> [<configure-option> ... ]
    19 #
    20 #    For example,
    21 #
    22 #       ac_add_options --with-pthreads --enable-debug
    23 #
    24 # ac_add_options can be called multiple times in .mozconfig.
    25 #    Each call adds more options to configure's command-line.
    27 # Note: $_AUTOCONF_TOOLS_DIR must be defined in the script that includes this.
    29 ac_add_options() {
    30   for _opt
    31   do
    32     # Escape shell characters, space, tab, dollar, quote, backslash, parentheses.
    33     _opt=`echo $_opt | sed -e 's/\([\ \	\$\"\\\(\)]\)/\\\\\1/g;s/@\([^@]*\)@/\$\1/g;'`
    34     _opt=`echo $_opt | sed -e 's/@\([^@]*\)@/\$(\1)/g'`
    36     # Avoid adding duplicates
    37     case "$ac_options" in
    38       # Note that all options in $ac_options are enclosed in quotes,
    39       # so there will always be a last character to match [^-A-Za-z0-9_]
    40       *"\"$_opt[^-A-Za-z0-9_]"* ) ;;
    41       * ) mozconfig_ac_options="$mozconfig_ac_options $_opt" ;;
    42     esac
    43   done
    44 }
    46 ac_add_app_options() {
    47   APP=$1
    48   shift;
    49   if [ "$APP" = "$MOZ_BUILD_APP" ]; then
    50       ac_add_options "$*";
    51   fi
    52 }
    54 mk_add_options() {
    55   # These options are for client.mk
    56   # configure can safely ignore them.
    57   :
    58 }
    60 ac_echo_options() {
    61   echo "Adding configure options from $FOUND_MOZCONFIG:"
    62   eval "set -- $mozconfig_ac_options"
    63   for _opt
    64   do
    65     echo "  $_opt"
    66   done
    67 }
    69 # Main
    70 #--------------------------------------------------
    71 topsrcdir=$(cd `dirname $0`; pwd -W 2>/dev/null || pwd)
    72 ac_options=
    73 mozconfig_ac_options=
    75 # Save the real command-line options
    76 for _opt
    77 do
    78   # Escape shell characters, space, tab, dollar, quote, backslash.
    79   _opt=`echo $_opt | sed -e 's/\([\ \	\$\"\\]\)/\\\\\1/g;'`
    80   ac_options="$ac_options \"$_opt\""
    81 done
    84 # If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out
    85 isfoundset=${FOUND_MOZCONFIG+yes}
    86 if [ -z $isfoundset ]; then
    87   FOUND_MOZCONFIG=`$_AUTOCONF_TOOLS_DIR/mozconfig-find $topsrcdir`
    88   if [ $? -ne 0 ]; then
    89     echo "Fix above errors before continuing." 1>&2
    90     exit 1
    91   fi
    92 fi
    94 if [ "$FOUND_MOZCONFIG" ]; then
    95   . "$FOUND_MOZCONFIG"
    96 fi
    97 export FOUND_MOZCONFIG
    99 if [ "$mozconfig_ac_options" ]; then
   100   ac_echo_options 1>&2
   101 fi
   103 eval "set -- $mozconfig_ac_options $ac_options"

mercurial