Skip to content
Snippets Groups Projects
Commit 9591ac5e authored by slamm%netscape.com's avatar slamm%netscape.com
Browse files

Change myconfig to mozconfig.

parent c9e99e50
No related merge requests found
......@@ -92,22 +92,13 @@ dnl This is used by webconfig to group options
define(MOZ_ARG_HEADER, [# $1])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
AC_DEFUN(MOZ_READ_MYCONFIG,
AC_DEFUN(MOZ_READ_MOZCONFIG,
[AC_REQUIRE([AC_INIT_BINSH])dnl
# Read in 'myconfig.sh' script to set the initial options.
# See the load-myconfig.sh script for more details.
_topsrcdir=`dirname [$]0`
for _config in $MOZ_MYCONFIG \
myconfig.sh \
$_topsrcdir/myconfig.sh \
$HOME/.mozmyconfig.sh
do
if test -f $_config; then
MOZ_MYCONFIG=$_config;
. $_topsrcdir/build/autoconf/load-myconfig.sh
break
fi
done])
# Read in 'mozconfig.sh' script to set the initial options.
# See the load-mozconfig.sh script for more details.
TOPSRCDIR=`dirname [$]0`
PATH="$TOPSRCDIR/build/autoconf:$PATH"
. load-mozconfig.sh])
dnl This gets inserted at the top of the configure script
MOZ_READ_MYCONFIG
MOZ_READ_MOZCONFIG
#! /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.
#
# find-mozconfig.sh - Loads options from mozconfig.sh onto configure's
# command-line. The mozconfig.sh file is searched for in the
# order:
# if $MOZCONFIG is set, use that.
# Otherwise, use $TOPSRCDIR/mozconfig.sh
# Otherwise, use $HOME/.mozconfig.sh
#
topsrcdir=`cd \`dirname $0\`/../..; pwd`
for _config in $MOZCONFIG \
$MOZ_MYCONFIG \
$topsrcdir/mozconfig.sh \
$topsrcdir/myconfig.sh \
$HOME/.mozconfig.sh \
$HOME/.mozmyconfig.sh
do
if test -f $_config; then
echo $_config;
exit 0
fi
done
......@@ -16,15 +16,15 @@
# Reserved.
#
# load-myconfig.sh - Loads options from myconfig.sh onto configure's
# command-line. The myconfig.sh is searched for in the following
# order: $MOZ_MYCONFIG, $objdir/myconfig.sh, $topsrcdir/myconfig.sh.
# load-mozconfig.sh - Loads options from mozconfig.sh onto configure's
# command-line. See find-mozconfig.sh for how the config file is
# found
#
# The options from myconfig.sh are inserted into the command-line
# The options from mozconfig.sh are inserted into the command-line
# before the real command-line options. This way the real options
# will override any myconfig.sh options.
# will override any mozconfig.sh options.
#
# myconfig.sh is a shell script. To add an option to configure's
# mozconfig.sh is a shell script. To add an option to configure's
# command-line use the pre-defined function, ac_add_options,
#
# ac_add_options <configure-option> [<configure-option> ... ]
......@@ -33,7 +33,7 @@
#
# ac_add_options --with-pthreads --enable-debug
#
# ac_add_options can be called multiple times in myconfig.sh.
# ac_add_options can be called multiple times in mozconfig.sh.
# Each call adds more options to configure's command-line.
#
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
......@@ -43,12 +43,13 @@ ac_add_options() {
for _opt
do
# Escape shell characters, space, tab, dollar, quote, backslash.
_opt=`echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g;'`
_opt=`echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g;s/@\([^@]*\)@/\$\1/g;'`
_opt=`echo $_opt | sed -e 's/@\([^@]*\)@/\$(\1)/g'`
# Avoid adding duplicates
case "$ac_options" in
*"$_opt"* ) ;;
* ) myconfig_ac_options="$myconfig_ac_options $_opt" ;;
* ) mozconfig_ac_options="$mozconfig_ac_options $_opt" ;;
esac
done
}
......@@ -60,8 +61,8 @@ mk_add_options() {
}
ac_echo_options() {
echo "Adding options from $MOZ_MYCONFIG:"
eval "set -- $myconfig_ac_options"
echo "Adding options from $MOZCONFIG:"
eval "set -- $mozconfig_ac_options"
for _opt
do
echo " $_opt"
......@@ -72,7 +73,7 @@ ac_echo_options() {
# Define load the options
#
ac_options=
myconfig_ac_options=
mozconfig_ac_options=
# Save the real command-line options
for _opt
......@@ -83,9 +84,14 @@ do
ac_options="$ac_options \"$_opt\""
done
. $MOZ_MYCONFIG
# Call find-mozconfig.sh
# In params: $MOZCONFIG $HOME (old:$MOZ_MYCONFIG)
MOZCONFIG=`$TOPSRCDIR/build/autoconf/find-mozconfig.sh`
ac_echo_options 1>&2
if [ "$MOZCONFIG" ]; then
. $MOZCONFIG
ac_echo_options 1>&2
fi
eval "set -- $myconfig_ac_options $ac_options"
eval "set -- $mozconfig_ac_options $ac_options"
......@@ -16,94 +16,66 @@
# Reserved.
#
# myconfig2defs.sh - Translates myconfig.sh into options for client.mk.
# mozconfig2defs.sh - Translates mozconfig.sh into options for client.mk.
# Prints defines to stdout.
#
# See load-myconfig.sh for more details
# See load-mozconfig.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() {
print_header() {
echo "# gmake"
echo "# This file is automatically generated for client.mk."
echo "# Do not edit. Edit $MOZ_MYCONFIG instead."
echo "# Do not edit. Edit $MOZCONFIG instead."
echo
eval "set -- $myconfig_ac_options"
}
ac_add_options() {
for _opt
do
# Escape shell characters, space, tab, dollar, quote, backslash,
# and substitute '@<word>@' with '$(<word)'.
_opt=`echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
case "$_opt" in
--with-nspr=* ) echo MOZ_WITH_NSPR=`expr $_opt : ".*=\(.*\)"` ;;
--with-pthreads* ) echo MOZ_WITH_PTHREADS=1 ;;
--*-* ) echo "# $_opt is not used by client.mk" ;;
esac
done
eval "set -- $myconfig_mk_options"
}
mk_add_options() {
for _opt
do
_opt=`echo $_opt | sed -e 's/@\([^@]*\)@/\$(\1)/g'`
echo $_opt
# Escape shell characters, space, tab, dollar, quote, backslash,
# and substitute '@<word>@' with '$(<word)'.
echo $_opt | sed -e 's/\([\ \ \$\"\\]\)/\\\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'
done
}
#
# Define load the options
# main
#
myconfig_ac_options=
myconfig_mk_options=
out_file=$1
tmp_file="$out_file-tmp$$"
trap "rm -f $tmp_file; exit 1" 1 2 15
find_myconfig
if [ ! -f $out_file ]; then
echo "# This file is automatically generated for client.mk." > $out_file
fi
# find-mozconfig.sh
# In params: $MOZCONFIG $HOME ($MOZ_MYCONFIG)
MOZCONFIG=`\`dirname $0\`/find-mozconfig.sh`
if [ "$MOZ_MYCONFIG" ]
if [ "$MOZCONFIG" ]
then
. $MOZ_MYCONFIG
ac_echo_options > $tmp_file
print_header >$tmp_file
. $MOZCONFIG >> $tmp_file
if cmp -s $tmp_file $out_file; then
rm $tmp_file
else
mv $tmp_file $out_file
mv -f $tmp_file $out_file
fi
else
echo "# This file is automatically generated for client.mk." > $out_file
fi
......@@ -38,7 +38,7 @@
# clean (also clobber)
#
# The nspr library is handled as follows,
# Read $HOME/.mozmyconfig.sh (or $(TOPSRCDIR)/myconfig.sh) and
# Read $HOME/.mozconfig.sh (or $(TOPSRCDIR)/mozconfig.sh) and
# get the directory specified by --with-nspr.
# If the flag is not there, look for nspr in /usr/bin.
# Otherwise, build from tip and install in $(OBJDIR)/dist/nspr
......@@ -58,10 +58,10 @@
CWD := $(shell pwd)
ifeq (mozilla, $(notdir $(CWD)))
ROOTDIR := $(shell dirname $(CWD))
TOPSRCDIR := $(CWD)
TOPSRCDIR := $(CWD)
else
ROOTDIR := $(CWD)
TOPSRCDIR := $(CWD)/mozilla
TOPSRCDIR := $(CWD)/mozilla
endif
AUTOCONF := autoconf
......@@ -72,7 +72,7 @@ MAKE := gmake
endif
WEBCONFIG_URL := http://cvs-mirror.mozilla.org/webtools/build/config.cgi
WEBCONFIG_FILE := $(HOME)/.mozmyconfig.sh
WEBCONFIG_FILE := $(HOME)/.mozconfig.sh
CONFIG_GUESS := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS
......@@ -81,17 +81,17 @@ else
IS_FIRST_CHECKOUT := 1
endif
# Load options from myconfig.sh
# Load options from mozconfig.sh
# (See build pages, http://www.mozilla.org/build/unix.html,
# for how to set up myconfig.sh.)
MYCONFIG2DEFS := build/autoconf/myconfig2defs.sh
# for how to set up mozconfig.sh.)
MOZCONFIG2DEFS := build/autoconf/mozconfig2defs.sh
run_for_side_effects := \
$(shell if test ! -f $(TOPSRCDIR)/$(MYCONFIG2DEFS); then \
cd $(ROOTDIR); \
cvs co mozilla/$(MYCONFIG2DEFS); \
fi; \
$(TOPSRCDIR)/$(MYCONFIG2DEFS) $(TOPSRCDIR)/.client-defs.mk)
-include $(TOPSRCDIR)/.client-defs.mk
$(shell cd $(TOPSRCDIR); \
if test ! -f $(MOZCONFIG2DEFS); then \
(cd ..; cvs co mozilla/$(MOZCONFIG2DEFS);) \
fi; \
$(MOZCONFIG2DEFS) .client-defs.mk)
include $(TOPSRCDIR)/.client-defs.mk
ifdef MOZ_OBJDIR
OBJDIR := $(MOZ_OBJDIR)
......@@ -284,7 +284,7 @@ build: nspr $(OBJDIR)/Makefile
# Build & install nspr. Classic build, no autoconf.
# Linux/RPM available.
nspr: $(NSPR_INSTALL_DIR)/lib/libnspr21.so
@echo NSPR is installed in $(NSPR_INSTALL_DIR)/lib
@echo NSPR is installed in $(NSPR_INSTALL_DIR)/lib objdir=$(OBJDIR)
$(NSPR_INSTALL_DIR)/lib/libnspr21.so:
@-$(MKDIR) -p $(NSPR_INSTALL_DIR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment