Changeset 267 for trunk/libjdkmidi/trunk
- Timestamp:
- 01/20/07 21:34:11 (22 months ago)
- Files:
-
- 1 modified
-
trunk/libjdkmidi/trunk/configure (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libjdkmidi/trunk/configure
r266 r267 87 87 # into a single instance of awk so it is quick. 88 88 # 89 # The awk script extracts the variable name as $1, and the part after the '=' as $2.89 # The awk script extracts the variable name as var, and the part after the first '=' as val 90 90 # It changes - to _, -- to nothing, converts the string to uppercase, prefixes the 91 # variable name with magic_, and prints $2 inside quotes. 92 # 93 # The result of the awk script is then a multi-line bash script which sets a bunch of environment 94 # variables. This text is then 'eval'd so ultimately the command line arguments show up as vars, 95 # with out needing ugly getopt bash extensions for parsing command lines. 96 97 params=`( 98 for i in "$@" 91 # variable name with magic_, and prints val inside quotes. 92 # 93 94 for i in "$@" 99 95 do 100 echo $i101 done102 ) | awk '{ line=$0; i = index($0,"="); var = substr(line,0,i); val = substr(line,i+1); gsub("-","_",var); sub("__","",var); print "magic_" toupper(var) "=" "\"" val "\""; }'; ` 103 104 eval $params 96 p=`echo $i | awk '{ line=$0; i = index($0,"="); var = substr(line,0,i-1); val = substr(line,i+1); gsub("-","_",var); sub("__","",var); print "magic_" toupper(var) "=\"" val "\"\n"; }' ` 97 eval $p 98 done 99 100 105 101 106 102 # setup all defaults: … … 217 213 218 214 215 219 216 # extract all environment vars with the "magic_" prefix and save them in vars.sh and GNUmakefile in the appropriate form: 220 set | grep '^magic_' | s ed "s/'//g" | awk '{ i = index($0,"="); print substr($0,7,i-7) "=\"" substr($0,i+1) "\"" }'>vars.sh217 set | grep '^magic_' | sort | sed "s/magic_\(.*\)=[\']*\([^']*\)[\']*/\1=\"\2\"/" >vars.sh 221 218 echo ". \"${magic_PROJECT_TOP_DIR}/project.sh\"" >>vars.sh 222 set | grep '^magic_' | sed "s/[\"']//g" | awk '{ i = index($0,"="); print substr($0,7,i-7) "=" substr($0,i+1) }' >GNUmakefile 219 set | grep '^magic_' | sort | sed "s/magic_\(.*\)=[\']*\([^']*\)[\']*/\1=\2/" >GNUmakefile 220 221 223 222 224 223 echo 'include $(CONFIGURE_DIR)/project.mak' >>GNUmakefile
