Replace an old hack in the ml script.

Instead of trying to determine the type of the C compiler in the ml script
based on the name of the C compiler executable, use the C compiler type
determined by the configure script.

scripts/ml.in:
    As above.
This commit is contained in:
Julien Fischer
2020-01-23 20:03:39 +11:00
parent 0d218e34c6
commit 1f3812e898

View File

@@ -35,6 +35,7 @@ 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@"}
MKFIFO=${MERCURY_MKFIFO="@MKFIFO@"}
ERROR_UNDEFINED="@ERROR_UNDEFINED@"
ALLOW_UNDEFINED="@ALLOW_UNDEFINED@"
@@ -72,24 +73,6 @@ SHARED_LIBS=${MERCURY_SHARED_LIBS="@SHARED_LIBS_SH@"}
LINK=${LINK=/stack:10485760} # 10 Mb
export LINK
case "$CC" in
*gcc*)
COMPILER=gcc
;;
*clang*)
COMPILER=clang
;;
*cl* | *CL*)
COMPILER=msvc
;;
cc* | */cc*)
COMPILER=cc
;;
*)
COMPILER=unknown
;;
esac
# 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.
@@ -365,9 +348,12 @@ esac
# Determine whether to link the executable with debugging symbols when using
# MSVC.
if test $strip = "false" -a $COMPILER = "msvc"
if test $strip = "false"
then
DEBUG_FLAG="-DEBUG"
case "$C_COMPILER_TYPE" in
msvc*) DEBUG_FLAG="-DEBUG" ;;
*) DEBUG_FLAG="" ;;
esac
else
DEBUG_FLAG=""
fi
@@ -556,12 +542,10 @@ case "$MKFIFO" in
;;
esac
if test $COMPILER = "msvc"
then
NOLOGO_OPTS="-nologo"
else
NOLOGO_OPTS=""
fi
case "$C_COMPILER_TYPE" in
msvc*) NOLOGO_OPTS="-nologo" ;;
*) NOLOGO_OPTS="" ;;
esac
LINKER_PRE_FLAGS="$NOLOGO_OPTS $MSVCRT_OPTS $PRINT_MAP_OPT $UNDEF_OPT $STRIP_OPTS $LTO_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS $SANITIZER_OPTS"
LINKER_POST_FLAGS="@LINK_OPT_SEP@ $NODEFAULTLIB_FLAG $DEBUG_FLAG $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS"