mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Convert myconfig.sh into makefile format for client.mk
This commit is contained in:
parent
abe3909f53
commit
b4d15d1372
92
build/autoconf/myconfig2defs.sh
Executable file
92
build/autoconf/myconfig2defs.sh
Executable file
@ -0,0 +1,92 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
# myconfig2defs.sh - Translates myconfig.sh into options for client.mk.
|
||||
# Prints defines to stdout.
|
||||
#
|
||||
# See load-myconfig.sh for more details
|
||||
#
|
||||
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
|
||||
|
||||
|
||||
# This functions needs to be kept in sync with the code in altoptions.sh.
|
||||
# Eventually I will put it in some common place.
|
||||
find_myconfig() {
|
||||
for _config in $MOZ_MYCONFIG \
|
||||
./myconfig.sh \
|
||||
$_topsrcdir/myconfig.sh \
|
||||
$HOME/.mozmyconfig.sh
|
||||
do
|
||||
if test -f $_config; then
|
||||
MOZ_MYCONFIG=$_config;
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
ac_add_options() {
|
||||
for _opt
|
||||
do
|
||||
# Escape shell characters, space, tab, dollar, quote, backslash.
|
||||
_opt=`echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g;'`
|
||||
|
||||
myconfig_ac_options="$myconfig_ac_options $_opt"
|
||||
done
|
||||
}
|
||||
|
||||
mk_add_options() {
|
||||
for _opt
|
||||
do
|
||||
# Escape shell characters, space, tab, dollar, quote, backslash.
|
||||
_opt=`echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g;'`
|
||||
|
||||
myconfig_mk_options="$myconfig_mk_options $_opt"
|
||||
done
|
||||
}
|
||||
|
||||
ac_echo_options() {
|
||||
echo "# gmake"
|
||||
echo "# This file is automatically generated. Do not edit."
|
||||
echo "# Edit $MOZ_MYCONFIG instead."
|
||||
echo
|
||||
eval "set -- $myconfig_ac_options"
|
||||
for _opt
|
||||
do
|
||||
case "$_opt" in
|
||||
--with-nspr=* ) echo MOZ_WITH_NSPR=`expr $_opt : ".*=\(.*\)"` ;;
|
||||
--with-pthreads* ) echo MOZ_WITH_PTHREADS=1 ;;
|
||||
esac
|
||||
done
|
||||
eval "set -- $myconfig_mk_options"
|
||||
for _opt
|
||||
do
|
||||
_opt=`echo $_opt | sed -e 's/@\([^@]*\)@/\$(\1)/g'`
|
||||
echo $_opt
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# Define load the options
|
||||
#
|
||||
myconfig_ac_options=
|
||||
myconfig_mk_options=
|
||||
|
||||
find_myconfig
|
||||
. $MOZ_MYCONFIG
|
||||
|
||||
ac_echo_options
|
Loading…
x
Reference in New Issue
Block a user