michael@0: #! /bin/sh michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # mozconfig2client-mk - Translates .mozconfig into options for client.mk. michael@0: # Prints defines to stdout. michael@0: # michael@0: # See mozconfig2configure for more details michael@0: michael@0: print_header() { michael@0: cat <@' with '$()'. michael@0: _opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'` michael@0: echo $_opt; michael@0: done michael@0: } michael@0: michael@0: # Main michael@0: #-------------------------------------------------- michael@0: michael@0: scriptdir=`dirname $0` michael@0: topsrcdir=$1 michael@0: michael@0: # If the path changes, configure should be rerun michael@0: echo "# PATH=$PATH" michael@0: michael@0: # If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out michael@0: isfoundset=${FOUND_MOZCONFIG+yes} michael@0: if [ -z $isfoundset ]; then michael@0: FOUND_MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir` michael@0: if [ $? -ne 0 ]; then michael@0: echo '$(error Fix above errors before continuing.)' michael@0: else michael@0: isfoundset=yes michael@0: fi michael@0: fi michael@0: michael@0: if [ -n $isfoundset ]; then michael@0: if [ "$FOUND_MOZCONFIG" ] michael@0: then michael@0: print_header michael@0: . "$FOUND_MOZCONFIG" michael@0: echo "FOUND_MOZCONFIG := $FOUND_MOZCONFIG" michael@0: fi michael@0: fi