Files
mercury/tools/configure_mingw_cross
Peter Wang 388938ac1e Delete use of signal handlers taking sigcontext arguments.
The configure checks for sigcontext (aka sigcontext_struct) have failed
for a long time without anyone noticing. The MR_GET_FAULT_ADDR macro
that is also needed for the sigcontext code paths was only ever defined
for __i386__ and __mc68000__.

According to the sigaction(2) man page, the struct sigcontext
argument was obsoleted by the introduction of the SA_SIGINFO flag
(which we also have code for, though also not working either).

configure.ac:
    Delete checks related to struct sigcontext.

    Delete check for asm/sigcontext.h

runtime/mercury_conf.h.in:
    Delete macros that are no longer defined.

runtime/mercury_memory_handlers.c:
runtime/mercury_signal.c:
runtime/mercury_signal.h:
    Delete code for using signal handlers that take a sigcontext argument.

    Add XXX where native GC casts a context parameter to
    struct sigcontext * when it should be a ucontext_t *.
    Possibly never tested.

runtime/mercury_faultaddr.h:
    Delete this file containing only the MR_GET_FAULT_ADDR macro which is
    no longer used.

runtime/RESERVED_MACRO_NAMES:
ssdb/RESERVED_MACRO_NAMES:
trace/RESERVED_MACRO_NAMES:
    Delete macros that are no longer defined.

tools/configure_mingw_cross:
    Don't need to set variables mercury_cv_sigcontext_struct_2arg and
    mercury_cv_sigcontext_struct_3arg any more.
2020-10-13 13:32:32 +11:00

90 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
#---------------------------------------------------------------------------#
# Copyright (C) 2012 The University of Melbourne.
# Copyright (C) 2014, 2018 The Mercury team.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
#
# This script prepares the Mercury source tree for building with a MinGW
# cross-compiler. Please see README.MinGW-cross for details.
#
#-----------------------------------------------------------------------------#
set -e
for arg
do
case $arg in
--host=*)
host=${arg#--host=}
break
;;
esac
done
host=${host:-i686-pc-mingw32}
hostcc=$host-gcc
case $host in
x86_64*)
bits=64 ;;
*)
bits=32 ;;
esac
echo "Configuring for host $host, assuming ${bits}-bit"
if command -v $hostcc >/dev/null
then
true
else
echo "You need $hostcc in your PATH."
exit 1
fi
if command -v mmc >/dev/null && mmc -v 2>&1 | grep -q Mercury
then
true
else
echo "You need a working native mmc in your PATH."
exit 2
fi
if test configure -ot configure.ac
then
aclocal -I m4 && autoconf
fi
if ! test -f configure.ac
then
echo "You need to run this script at the top of the Mercury tree."
exit 3
fi
# Set values which would otherwise be determined with AC_TRY_RUN.
# Taken from the config.cache file after running configure -C in msys.
mercury_cv_cc_type=gcc \
mercury_cv_sigaction_field=no \
mercury_cv_siginfo_t=no \
mercury_cv_is_bigender=no \
mercury_cv_is_littleender=yes \
mercury_cv_normal_system_retval=no \
mercury_cv_can_do_pending_io=no \
mercury_cv_gcc_labels=yes \
mercury_cv_asm_labels=yes \
mercury_cv_gcc_model_fast=yes \
mercury_cv_gcc_model_reg=yes \
mercury_cv_cannot_use_structure_assignment=yes \
sh configure "$@" \
--host=$host \
--with-cc=$hostcc
echo
echo "If you wish to run mmake in the subdirectories, you will need to set"
echo "MMAKE_DIR=`pwd`/scripts"
echo
exit