build/autoconf/mozconfig2client-mk

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 # mozconfig2client-mk - Translates .mozconfig into options for client.mk.
     8 #    Prints defines to stdout.
     9 #
    10 # See mozconfig2configure for more details
    12 print_header() {
    13   cat <<EOF
    14 # gmake
    15 # This file is automatically generated for client.mk.
    16 # Do not edit. Edit $FOUND_MOZCONFIG instead.
    18 EOF
    19 }
    21 ac_add_options() {
    22   for _opt
    23   do
    24     case "$_opt" in
    25     --target=*)
    26       echo $_opt | sed s/--target/CONFIG_GUESS/
    27       ;;
    28     *)
    29       echo "# $_opt is used by configure (not client.mk)"
    30       ;;
    31     esac
    32   done
    33 }
    35 ac_add_app_options() {
    36   echo "# $* is used by configure (not client.mk)"
    37 }
    39 mk_add_options() {
    40   for _opt
    41   do
    42     # Escape shell characters, space, tab, dollar, quote, backslash,
    43     # and substitute '@<word>@' with '$(<word>)'.
    44     _opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
    45     echo $_opt;
    46   done
    47 }
    49 # Main
    50 #--------------------------------------------------
    52 scriptdir=`dirname $0`
    53 topsrcdir=$1
    55 # If the path changes, configure should be rerun
    56 echo "# PATH=$PATH"
    58 # If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out
    59 isfoundset=${FOUND_MOZCONFIG+yes}
    60 if [ -z $isfoundset ]; then
    61   FOUND_MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir`
    62   if [ $? -ne 0 ]; then
    63     echo '$(error Fix above errors before continuing.)'
    64   else
    65     isfoundset=yes
    66   fi
    67 fi
    69 if [ -n $isfoundset ]; then
    70   if [ "$FOUND_MOZCONFIG" ]
    71   then
    72     print_header
    73     . "$FOUND_MOZCONFIG"
    74     echo "FOUND_MOZCONFIG := $FOUND_MOZCONFIG"
    75   fi
    76 fi

mercurial