diff options
Diffstat (limited to 'salis')
-rwxr-xr-x | salis | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -91,6 +91,7 @@ options=( "t|thread-gap|N|Memory gap between cores in bytes (could help reduce cache misses?)||0x100|bench:load:new" "u|ui|UI|User interface|${uis}|curses|load:new" "y|sync-pow|POW|Core sync interval exponent (interval == 2^POW)||20|bench:new" + "x|compress||Compress save files (requires 'zlib')||true|new" "z|auto-save-pow|POW|Auto-save interval exponent (interval == 2^POW)||36|new" ) @@ -196,7 +197,8 @@ parse_next() { nopt=opt_${lopt//-/_} if [[ -z ${meta} ]] ; then - eval ${nopt}=true + defv=`field "${vopt}" 6` + eval ${nopt}=`[[ ${defv} == true ]] && echo false || echo true` shift_next=1 else eval ${nopt}=${2} @@ -275,7 +277,7 @@ act_new=3 act_var="act_${cmd}" -gcc_flags="-Wall -Wextra -Werror -std=c11 -pedantic" +gcc_flags="-Wall -Wextra -Werror -std=gnu11 -pedantic" fquote() { echo "\\\"${1}\\\"" @@ -285,7 +287,7 @@ fpow() { printf '%#xul' $((1 << ${1})) } -bcmd="gcc src/salis.c -o ${salis_exe} ${gcc_flags} -Isrc -lncursesw -pthread" +bcmd="gcc src/salis.c -o ${salis_exe} ${gcc_flags} -Isrc -pthread" bcmd="${bcmd} `[[ ${opt_optimized} == true ]] && echo "-O3 -DNDEBUG" || echo "-ggdb"`" bcmd="${bcmd} -DACTION=${!act_var}" bcmd="${bcmd} -DARCHITECTURE=`fquote ${opt_arch}`" @@ -337,7 +339,18 @@ load|new) bcmd="${bcmd} -DMUTA_FLIP_BIT=`[[ ${opt_muta_flip} == true ]] && echo 1 || echo 0`" bcmd="${bcmd} -DSIM_NAME=`fquote ${opt_name}`" bcmd="${bcmd} -DSIM_PATH=`fquote ${sim_path}`" - bcmd="${bcmd} -DUI=`fquote ui/${opt_ui}.c`" + + ui_file=ui/${opt_ui}.c + ui_flags=`sed -n -e 's/^.*GCC_EXTRA_FLAGS //p' src/${ui_file}` + + shopt -s extglob + bcmd="${bcmd} -DUI=`fquote ${ui_file}` ${ui_flags}" + bcmd="${bcmd%%*( )}" + shopt -u extglob + + if [[ ${opt_compress} == true ]] ; then + bcmd="${bcmd} -DCOMPRESS -lz" + fi ;; esac |