Fix bugs and nits pointed out by shellcheck.

scripts/mgnuc.in:
    Delete the unused variables AS, AS_OPTS, HLD_OPTS and ARG_OPTS.
    The first two are hstorical relics, HLD_OPTS lost its raison d'etre
    when we deleted the hl grades; I don't know what we used ARG_OPTS for.

    Make the unused variable CFLAGS_FOR_ANSI used.

    Fix a spelling inconsistency: DEBUG_OPT vs DEBUG_OPTS.

scripts/ml.in:
    Delete the unused variables NONSHARED_LIB_DIR and DL_LIBRARY.

scripts/parse_grade_options.sh-subr:
    Fix typos that prevented an almost-never-used option from working.

scripts/parse_ml_options.sh-subr.in:
    Fix a quoting error.

tools/bootcheck:
    Comment out the definition of an unused variable. (Its parallel
    exists and is used in c2init.in, which is why it is not deleted.)

    Fix typos in spelling SSDB_LIB_NAME.

    Quote a variable value that may contain spaces.

    Replace "cat file | cmd" with "cmd < file".
This commit is contained in:
Zoltan Somogyi
2020-05-29 21:18:08 +10:00
parent 2d2272a9ee
commit 79d81d09d8
5 changed files with 23 additions and 35 deletions

View File

@@ -18,7 +18,6 @@
# *************************************************************************
FULLARCH=@FULLARCH@
NONSHARED_LIB_DIR=${MERCURY_NONSHARED_LIB_DIR=@NONSHARED_LIB_DIR@}
DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
CC=${MERCURY_C_COMPILER="@CC@"}
@@ -30,14 +29,13 @@ CFLAGS_FOR_LTO="@CFLAGS_FOR_LTO@"
CFLAGS_FOR_NO_STRICT_ALIASING="@CFLAGS_FOR_NO_STRICT_ALIASING@"
CFLAGS_FOR_ANSI="@CFLAGS_FOR_ANSI@"
CFLAGS_FOR_SANITIZERS="@CFLAGS_FOR_SANITIZERS@"
AS="@AS@"
BYTES_PER_WORD="@BYTES_PER_WORD@"
MKTEMP=@MKTEMP@
TMPDIR=${TMPDIR=/tmp}
case "${C_COMPILER_TYPE}" in
gcc*)
ANSI_OPTS="@CFLAGS_FOR_ANSI@"
ANSI_OPTS="${CFLAGS_FOR_ANSI}"
CHECK_OPTS="
-Wall -Wwrite-strings
-Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wno-unused"
@@ -71,7 +69,7 @@ case "${C_COMPILER_TYPE}" in
OPT_OPTS="-O2 ${CFLAGS_FOR_NO_STRICT_ALIASING} -fomit-frame-pointer"
;;
esac
DEBUG_OPT="-g"
DEBUG_OPTS="-g"
DISABLE_OPTS_OPT="-O0"
COMPILER_HALT_AT_WARN_OPT="-Werror"
COMPILER=gcc
@@ -80,7 +78,7 @@ case "${C_COMPILER_TYPE}" in
ANSI_OPTS=
CHECK_OPTS="-w"
OPT_OPTS="@OPT_FLAGS_FOR_CLANG@ ${CFLAGS_FOR_NO_STRICT_ALIASING} -fomit-frame-pointer"
DEBUG_OPT="-g"
DEBUG_OPTS="-g"
DISABLE_OPTS_OPT="-O0"
COMPILER_HALT_AT_WARN_OPT="-Werror"
COMPILER=clang
@@ -100,14 +98,13 @@ case "${C_COMPILER_TYPE}" in
ANSI_OPTS=
CHECK_OPTS=
OPT_OPTS="-O"
DEBUG_OPT="-g"
DEBUG_OPTS="-g"
DISABLE_OPTS_OPT="-O0"
COMPILER_HALT_AT_WARN_OPT=""
COMPILER=unknown
;;
esac
AS_OPTS=""
SPLIT_OPTS=""
INLINE_ALLOC_OPTS=""
@@ -255,7 +252,7 @@ ALL_LOCAL_C_INCL_DIRS=${MERCURY_ALL_LOCAL_C_INCL_DIRS=@ALL_LOCAL_C_INCL_DIRS@}
# compiler/compile_target_code.m.
case ${c_debug} in
true) C_DEBUG_OPTS="${DEBUG_OPT}" ;;
true) C_DEBUG_OPTS="${DEBUG_OPTS}" ;;
false) C_DEBUG_OPTS="" ;;
esac
@@ -469,7 +466,7 @@ case ${ss_debug} in
esac
case ${ll_debug} in
true) LL_DEBUG_OPTS="-DMR_LL_DEBUG ${DEBUG_OPT} ${DISABLE_OPTS_OPT}" ;;
true) LL_DEBUG_OPTS="-DMR_LL_DEBUG ${DEBUG_OPTS} ${DISABLE_OPTS_OPT}" ;;
false) LL_DEBUG_OPTS="" ;;
esac
@@ -701,7 +698,6 @@ ALL_CC_OPTS="${MERC_ALL_C_INCL_DIRS}\
${OPT_OPTS}\
${LTO_OPTS}\
${HLC_OPTS}\
${HLD_OPTS}\
${GCC_OPTS}\
${HALT_AT_WARN_OPT}\
${MSVCRT_OPTS}\
@@ -731,7 +727,6 @@ ALL_CC_OPTS="${MERC_ALL_C_INCL_DIRS}\
${THREADSCOPE_OPTS}\
${REGION_OPTS}\
${ARCH_OPTS}\
${ARG_OPTS}\
${FN_ALIGN_OPTS}\
${INVISIBLE_OPTS}"

View File

@@ -33,7 +33,6 @@ DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
# add /usr/local/lib to the default search path, if needed
ALL_LOCAL_C_LIB_DIRS=${MERCURY_ALL_LOCAL_C_LIB_DIRS=@ALL_LOCAL_C_LIB_DIRS@}
NONSHARED_LIB_DIR=${MERCURY_NONSHARED_LIB_DIR=@NONSHARED_LIB_DIR@}
DEMANGLER=${MERCURY_DEMANGLER=mdemangle}
CC=${MERCURY_C_COMPILER="@CC@"}
C_COMPILER_TYPE=${MERCURY_C_COMPILER_TYPE="@C_COMPILER_TYPE@"}
@@ -74,11 +73,6 @@ SHARED_LIBS=${MERCURY_SHARED_LIBS="@SHARED_LIBS_SH@"}
LINK=${LINK=/stack:10485760} # 10 Mb
export LINK
# On some systems we need -ldl (libdl.so) for dlopen() etc.
# The name of the needed library is determined by autoconf and passed through
# this variable.
DL_LIBRARY="@DL_LIBRARY@"
# Likewise for -lreadline -l{termcap,curses,ncurses}
READLINE_LIBRARIES="@READLINE_LIBRARIES@"

View File

@@ -226,10 +226,10 @@
;;
--low-level-debug)
ll_debug= true
ll_debug=true
;;
--no-low-level-debug)
ll_debug= false
ll_debug=false
;;
--extend-stacks-when-needed)

View File

@@ -187,7 +187,7 @@ Initialization options:
Mercury runtime. Flags can also be passed at runtime
in the MERCURY_OPTIONS environment variable.
For the list of available flags, see the documentation
for MERCURY_OPTIONS in the "Environment" chapter
for MERCURY_OPTIONS in the \"Environment\" chapter
of the Mercury User's Guide.
--experimental-complexity <filename>
Set up for the experimental determination of the complexity