-?RCS: $Id: Options.U,v 3.0.1.7 1997/02/28 15:08:15 ram Exp $
+?RCS: $Id: Options.U 1 2006-08-24 12:32:52Z rmanfredi $
?RCS:
-?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
-?RCS: of the source tree for dist 3.0.
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: Options.U,v $
?RCS: Revision 3.0.1.7 1997/02/28 15:08:15 ram
?RCS: patch49: this unit now exports file optdef.sh, not a variable
?RCS:
?RCS: Revision 3.0.1.3 1995/01/11 15:19:00 ram
-?RCS: patch45: new -O option allowing -D and -U to override config.sh setttings
+?RCS: patch45: new -O option allowing -D and -U to override config.sh settings
?RCS: patch45: file optdef.sh is no longer removed after sourcing
?RCS:
?RCS: Revision 3.0.1.2 1994/10/29 15:58:06 ram
?V:reuseval alldone error realsilent silent extractsh fastread \
override knowitall: config_sh
?T:arg argn symbol config_arg0 config_args config_argc xxx yyy zzz uuu
-?T:args_exp args_sep arg_exp libswanted
+?T:args_exp args_sep arg_exp ccflags
+?F:!Configure
?F:./optdef.sh ./cmdline.opt ./posthint.sh ./cmdl.opt
-
: Save command line options in file UU/cmdline.opt for later use in
: generating config.sh.
?X: This temporary file will be read by Oldsym.U. I used a temporary
?X: I don't imagine anyone actually having to do that, I'm not going
?X: to worry too much.
cat > cmdline.opt <<EOSH
-# Configure command line arguments.
+: Configure command line arguments.
config_arg0='$0'
config_args='$*'
config_argc=$#
cat >>cmdline.opt <<EOSH
config_arg$argn='$arg'
EOSH
- # Extreme backslashitis: replace each ' by '"'"'
+?X: Extreme backslashitis: replace each ' by '"'"'
cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
$arg
EOC
argn=`expr $argn + 1`
args_sep=' '
done
-# args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
-# used by ./hints/os2.sh
+?X: args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
+?X: used by hints/os2.sh in Perl, for instance
rm -f cmdl.opt
: produce awk script to parse command line options
: process the command line options
?X: Use "$@" to keep arguments with spaces in them from being split apart.
?X: For the same reason, awk will output quoted arguments and the final eval
-?X: removes them and sets a proper $* array. An 'X' is prependend to each
+?X: removes them and sets a proper $* array. An 'X' is prepended to each
?X: argument before being fed to echo to guard against 'echo -x', where -x
?X: would be understood as an echo option! It is removed before feeding awk.
set X `for arg in "$@"; do echo "X$arg"; done |
case "$zzz" in
*:*) zzz='' ;;
*) xxx=append
- zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
+ zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
esac
;;
*) xxx=`echo "$yyy"|sed 's!:.*!!'`
yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
esac
- ;;
+ ;;
esac
case "$xxx" in
append)
-U symbol= symbol gets completely empty
e.g.: -Uversiononly
-A : manipulate symbol after the platform specific hints have been applied:
- -A symbol=value append " "value to symbol
- -A append:symbol=value append value to symbol
- -A define:symbol=value define symbol to have value
- -A clear:symbol define symbol to be ''
- -A define:symbol define symbol to be 'define'
- -A eval:symbol=value define symbol to be eval of value
- -A prepend:symbol=value prepend value to symbol
- -A undef:symbol define symbol to be 'undef'
- -A undef:symbol= define symbol to be ''
+ -A append:symbol=value append value to symbol
+ -A symbol=value like append:, but with a separating space
+ -A define:symbol=value define symbol to have value
+ -A clear:symbol define symbol to be ''
+ -A define:symbol define symbol to be 'define'
+ -A eval:symbol=value define symbol to be eval of value
+ -A prepend:symbol=value prepend value to symbol
+ -A undef:symbol define symbol to be 'undef'
+ -A undef:symbol= define symbol to be ''
e.g.: -A prepend:libswanted='cl pthread '
+ -A ccflags=-DSOME_MACRO
-V : print version number and exit (with a zero status).
EOM
exit 1
touch optdef.sh
. ./optdef.sh
: create the posthint manipulation script and leave the file out there...
+?X: this file will be perused by Oldconfig.U
touch posthint.sh